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
}
精彩评论