hoverIntent basic issue?
I've been pouring over the following code, trying to get the hoverIntent plugin to work, to no avail. It's very basic stuff (if you have any consolidation ideas, please feel free) - .hover works fine, but .hoverIntent = no dice.
Basically, I just want a large img to change when a user mouses over a开发者_JAVA技巧 thumbnail, but to avoid wackiness, just wait a few before firing.
My jQuery (UPDATED AND WORKING MOSTLY) code:
function makeShow1(){
$("#some-div img").hide();
$(".uno").show();
}
function makeShow2(){
$("#some-div img").hide();
$(".dos").show();
}
function makeShow3(){
$("#some-div img").hide();
$(".tres").show();
}
function makeShow4(){
$("#some-div img").hide();
$(".quattro").show();
}
function makeShow5(){
$("#some-div img").hide();
$(".cinco").show();
}
function passOut() {
$.(this).stop();
}
$(document).ready(function () {
$(".switch1").hoverIntent( {
over: makeShow1,
timeout: 500,
interval: 300,
out: passOut
});
$(".switch2").hoverIntent( {
over: makeShow2,
timeout: 500,
interval: 300,
out: passOut
})
$(".switch3").hoverIntent( {
over: makeShow3,
timeout: 500,
interval: 300,
out: passOut
})
$(".switch4").hoverIntent( {
over: makeShow4,
timeout: 500,
interval: 300,
out: passOut
})
$(".switch5").hoverIntent( {
over: makeShow5,
timeout: 500,
interval: 300,
out: passOut
})
});
</script>
Try this example
First please check if hoverintent is loaded properly , you can do that through firebug and later you can verify if there are any errors not..in firebug conole
create two functions and try below code to check if it is working.
$('.classname').hoverIntent({
over: functionname2,
timeout: 500,
interval: 300,
out: functionname1
});
精彩评论