本文介绍了如何使用Pixastic jQuery多次旋转?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
单击时尝试旋转图像(使用Pixastic),但只能旋转1次,每次单击图像时如何继续旋转
I try to rotate my image when I click(using Pixastic) but I can only rotate 1 time, how can I go on rotating each time I click to the image
$('#tok').click(function() {
$("#tok").pixastic("rotate", {angle:90});
});
推荐答案
我以前没有使用过Pixastic.但是,我相信,每次单击图像时,都必须将角度增加90度.
I have NOT used Pixastic before. But, I believe, everytime the image is clicked , you have to increase the angle 90 .
First Click -> 90
Second Click->180
Third Click ->270
Fourth Click ->360
Fifth Click ->90..etc
已更新:
Pixastic似乎先删除图像,然后再次插入.这就是为什么onClick处理程序只执行一次的原因.将其更改为实时",它将起作用.
It seems Pixastic remove the image first and insert it again. That's why onClick handler is executed once. Change it to "live" and it will work.
$('#tok').live('click',function() {
$(this).pixastic("rotate", {angle:90});
});
在此处检查演示:.
这篇关于如何使用Pixastic jQuery多次旋转?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!