【发布时间】:2012-06-11 05:44:24
【问题描述】:
当单击我为图像淡入使用 hoverintent 制作的此代码时,您将如何禁用链接。我现在使用的是命名锚点,但它会跳转,所以我想禁用点击。
<A class="next2 nextbuttonB" href="#top">INSTALL</A>
<A class="next2 nextbuttonA" href="#top">ESTIMATE</A>
和jquery
$('#A,#B,').addClass('nextHide');
$('.nextbuttonA').hoverIntent(function() {
$('#A').fadeIn("slow");$('#B').fadeOut();
}, function() {
$('#B').hide();
});
$('.nextbuttonB').hoverIntent(function() {
$('#B').fadeIn("slow");$('#A').fadeOut();
}, function() {
$('#A').hide();
});
$('.nextbutton').hoverIntent(function() {
$('#A,#B').fadeOut();
}, function() {
$('#A,#B').hide();
});
$('#A,#B').mouseleave(function(){
$('#A,#B').fadeOut();
});
【问题讨论】:
-
event.preventDefault()或return false将解决问题。
标签: jquery hoverintent