我有一个圆圈,我需要在.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次。

但我似乎无法实现它,这就是为什么我现在转向你的专家:)

有帮助吗?

解决方案

您需要增量旋转。

我认为这个主题对你有一些好的提示:

45度旋转增量在点击w / out使用变量

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top