我已经倾注了以下代码,试图让hoverIntent插件工作,但无济于事。这是非常基本的东西(如果你有任何整合的想法,请随意)- .hover工作很好,但.hoverIntent =没有骰子。
基本上,我只想在用户将鼠标移到缩略图上时更改一个大的img,但为了避免混乱,在触发之前只需等待几次即可。
我的jQuery (已更新且基本正常工作)代码:
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>发布于 2010-12-04 02:09:58
试一下这个例子
首先,请检查是否正确加载了not..in意图,您可以通过firebug执行此操作,稍后您可以验证是否存在任何错误
创建两个函数,并尝试下面的代码来检查它是否正常工作。
$('.classname').hoverIntent({
over: functionname2,
timeout: 500,
interval: 300,
out: functionname1
});https://stackoverflow.com/questions/4348401
复制相似问题