我正在使用下面的jQuery/javascript来控制菜单的悬停功能.当"项目包装"项目悬停时,它会显示工具提示子菜单.
我希望为此代码添加两项功能:
1)仅在500毫秒的鼠标悬停在菜单项上后才显示工具提示
2)让用户能够移开工具提示并使其保持可见约1秒钟(从而使它们可以选择在它消失之前向后移动)
$(".item-wrapper").hover(function() {
$('#' + $(this).attr("rel") + '-tip').fadeIn("fast").show(); //add 'show()'' for IE
},
function() {//hide tooltip when the mouse moves off of the element
$('#' + $(this).attr("rel") + '-tip').hide();
});
Run Code Online (Sandbox Code Playgroud)
所有帮助非常感谢