Check if click occured inside or outside of modal window
This question already has an answer here:
lets say your modal window id is modal
.
with jQuery:
$(function(){
$(document).click(function(){
console.log('document is clicked');
});
$('#modal').click(function(e){
e.preventDefault();
e.stopPropagation();
console.log('modal is clicked');
});
});
hope that helps.
链接地址: http://www.djcxy.com/p/14718.html下一篇: 检查点击模式窗口内部或外部是否发生