简体   繁体   English

jQuery-背景位置动画缓动不起作用

[英]jQuery - Background-Position Animation Easing Not Working

I'm trying to change the background-position of an image like an odometer. 我正在尝试更改里程表等图像的背景位置。 Everything seems to work other than the easing, it just changes in 'linear' other than 'swing'. 一切似乎都与宽松政策不同,它只是在“线性”变化而不是“波动”。 Is very annoying, I've search high and low and have found nothing. 太烦人了,我搜寻了很多东西,却一无所获。

        col.animate({
            'background-position': '0 ' + ((newDigit * settings.heightNumber * -1) + zeroSet)
        }, 
        1000, 
        'swing');
      }

I also need this to work cross-browser. 我还需要此工具才能跨浏览器工作。 It does work cross-browser at present without easing. 目前,它确实可以跨浏览器运行,而不会放松。

Any help would be great. 任何帮助都会很棒。

"swing" is the default parameter. “ swing”是默认参数。 passing "swing" is like passing no parameter. 传递“ swing”就像传递任何参数一样。 you can use jquery ui which has a lot more easing styles. 您可以使用具有更多缓动样式的jui ui。 http://jqueryui.com/demos/effect/easing.html http://jqueryui.com/demos/effect/easing.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM