jQuery("#markets_served").hover(function(){
jQuery.data(document.body, "ms_height", jQuery(this).height());
if(jQuery.data(document.body, "ms_height") == 35) {
jQuery(this).stop().animate({height:'195px'},{queue:false, duration:800, easing: 'easeOutQuad'});
jQuery("#btn_ms_close").css("display","inline");
}
});
jQuery("#btn_ms_close").hover(function(){
jQuery.data(document.body, "ms_height", jQuery("#markets_served").height());
jQuery("#markets_served").stop().animate({height:'35px'},{queue:false, duration:800, easing: 'easeOutQuad'});
jQuery(this).css("display","none");
});
悬停问题。它不会起作用。当鼠标离开悬停时显示的内容时,它不会悬停。
http://uscc.dreamscapesdesigners.net/ - 底部的示例“覆盖的市场”
最佳答案
看看hover jQuery 网站上的声明。您可以一次性指定 mouseover 和 mouseout 事件的处理程序。无需计算高度或将另一个处理程序绑定(bind)到出现的新 div。
$("#markets_served").hover(
function () {
//do this when over
},
function () {
//do this when out
}
);
关于javascript - 悬停功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10302101/