0
当点击浏览器滚动条时,我的弹出窗口关闭。 我用这个代码关闭弹出:点击浏览器滚动条关闭弹出框
//Closing the pop up when clicked outside of it.
$(document).click(function(e) {
$("#popup").mouseup(function() {
return false;
});
// Bind mouseup event to all the document
$(document).mouseup(function(e) {
// Check if the click is outside the popup
if($(e.target).parents("#popup").length==0 && !$(e.target).is("#popup") && $(e.target).parents(".calendar").length==0) {
// Hide the popup
alert("hi");
$("#popup").hide();
}
});
});
我的弹出窗口CSS是:
element.style {
display: block;
}
.popupDiv {
background: none repeat scroll 0 0 rgb(245, 245, 245);
border-width: 1px 1px 3px;
padding: 10px 10px 35px;
position: absolute;
right: 0;
top: 85px;
z-index: 999;
}
我需要弹出没有关闭,当我点击浏览器的滚动条上。
请添加上的jsfiddle你的代码.... – Krish