开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜