美好的一天!
上述主题有点问题。 在某个页面上,我有多个齿轮而不是旋转,速度取决于滚动。
然而,一旦我垂直移动屏幕,我可以看到齿轮非常快速地抖动。
非常感谢我对自己做错的任何见解。
这是我的代码。
jQuery(window).scroll(function() {//GEAR SPINS
var theta = jQuery(window).scrollTop() ;
jQuery('.left-wheel').css({ transform: 'rotate(' + theta/2 + 'deg)' });
jQuery('.right-wheel').css({ transform: 'rotate(-' + theta/2 + 'deg)' });
afterscroll = theta/2;
});