开发者

jquery: animate background position without plugin?

开发者 https://www.devze.com 2023-03-04 18:07 出处:网络
hey guys, I have no luck making a simple background image animation working without the background-position-plugin of protofunc().

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:

    //Com开发者_Go百科ment form
$("#comment").focus(function() {
    $(this).css({"background-color":"#fff"});
    $(this).animate({backgroundPosition: '220% 16px'}, {
        duration: 500,
        easing: 'easeOutQuint',
        complete: function() { }
    });

});


Either revert back to a previous version of jQuery that worked, or set an actual <img>as the background and animate that.

0

精彩评论

暂无评论...
验证码 换一张
取 消