现在,当我单击“x”时,我正在关闭警报框,但我想在单击外部时关闭警报框。
请在此处查看我的代码:http: //jsfiddle.net/Ur5Xn/
如何关闭警报框点击它之外?
jQuery:
$(document).ready(function(){
function showAlertBox(){
$("#alert").css("display","inherit");
$("#content").addClass("back");
}
function removeAlertBox(){
$("#alert").css("display","none");
$("#content").removeClass("back");
}
$("#alertClose").click(function(){
removeAlertBox();
});
$("#alertShow").click(function(){
showAlertBox();
});
});