开发者

Why will my .hoverIntent to animate background position not work?

开发者 https://www.devze.com 2023-03-03 17:45 出处:网络
Ok, So i\'m trying to animate some social network icons using hoverIntent, I\'ve used hoverIntent on other parts of my page and it works fine. I\'m not getting an error messages, just nothing is happe

Ok, So i'm trying to animate some social network icons using hoverIntent, I've used hoverIntent on other parts of my page and it works fine. I'm not getting an error messages, just nothing is happening!

                $("ul.social-networks li.flickr").each(function(index) {
                $(this).hoverIntent(
                    function() {
                        $(this).animate({backgroundPosition: "(-84px -28px)"},
                        {duration:200});
                    },
                    function() {
                        $(this).animate({backgroundPosition: "(-84px 0px)"},
                        {duration:200});
                    });
                console.开发者_如何学Pythondebug($(this));
            });


hoverIntent requires both over and out functions:

$(document).ready(function(){
    $(".tag").hoverIntent({
        over: onHoverFunction, 
        timeout: 500, // believe time in milliseconds
        out: onLeaveFunction
    });

}); // close document.ready

function onHoverFunction(){
    // Code 
}
function onLeaveFunction(){
    // Code 
}
0

精彩评论

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