使用prev和next,为css3旋转onclick
-
26-12-2019 - |
题
我有一个圆圈,我需要在.next类上被解雇时,在.next类上被解雇时,我需要在..prev时,在-900点击时.prev
我已经设法根据我可以谷歌自己创建以下代码!
$('.next').on('click',function(e){
$('.object').animate({textIndent: 90}, {
step: function(now,fx) {
$(this).css('-webkit-transform','rotate('+now+'deg)').css('-moz-transform','rotate('+now+'deg)').css('transform','rotate('+now+'deg)');
},
duration:2000
},'linear');
});
$('.prev').on('click',function(e){
$('.object').animate({textIndent: 0}, {
step: function(now,fx) {
$(this).css('-webkit-transform','rotate('+now+'deg)').css('-moz-transform','rotate('+now+'deg)').css('transform','rotate('+now+'deg)');
},
duration:2000
},'linear');
});
.
到目前为止,它只需点击一下!但是,如果单击.next,请在.NEXT上点击两次,我需要它来旋转180 ..PREV的4次。
但我似乎无法实现它,这就是为什么我现在转向你的专家:)
解决方案
不隶属于 StackOverflow