jquery:没有插件的动画背景位置?(jquery: animate background position without plugin?)

编程入门 行业动态 更新时间:2024-10-28 04:19:20
jquery:没有插件的动画背景位置?(jquery: animate background position without plugin?)

嘿伙计们,我没有运气在没有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.

更多推荐

本文发布于:2023-07-16 07:47:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1125548.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:插件   背景   位置   动画   jquery

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!