嘿伙计们,我没有运气在没有protofunc()的background-position-plugin的情况下制作一个简单的背景图像动画。
我之前使用过该插件,一切正常。 然而,自从jQuery的1.6版本以来,该插件已被破坏并且不再起作用。
有没有机会我可以在没有这个插件的情况下制作一个简单的backgroundPosition动画?
这是我正在使用的代码:
//Comment form $("#comment").focus(function() { $(this).css({"background-color":"#fff"}); $(this).animate({backgroundPosition: '220% 16px'}, { duration: 500, easing: 'easeOutQuint', complete: function() { } }); });hey guys, I have no luck making a simple background image animation working without the background-position-plugin of protofunc().
I used the plugin before and everything worked fine. However since the 1.6 version of jQuery the plugin is broken and doesn't work anymore.
Is there any chance I can make an easy backgroundPosition Animation without this Plugin?
This is the code I'm using:
//Comment form $("#comment").focus(function() { $(this).css({"background-color":"#fff"}); $(this).animate({backgroundPosition: '220% 16px'}, { duration: 500, easing: 'easeOutQuint', complete: function() { } }); });最满意答案
要么恢复到以前版本的jQuery,要么将实际的<img>为背景并为其设置动画。
Either revert back to a previous version of jQuery that worked, or set an actual <img>as the background and animate that.
更多推荐
发布评论