18,356
社区成员
发帖
与我相关
我的任务
分享
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>dblclick demo</title>
<style>
div {
background: blue;
color: white;
height: 100px;
width: 150px;
}
div.dbl {
background: yellow;
color: black;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
</head>
<body>
<div></div>
<span>Double click the block</span>
<script>
function custom_close(){
if
(confirm("Close the page?")){
window.opener=null;
window.open('','_self');
window.close();
}
else{}
}
var divdbl = $( "div:first" );
divdbl.dblclick(function() {
custom_close();
});
</script>
</body>
</html>