關(guān)閉窗口時(shí)怎們延遲幾秒關(guān)閉
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>window.open 打開新窗口</title>
<script type="text/javascript">
? function Wopen(){
? ? window.open('http://idcbgp.cn','_blank','width=1000,height=1000,top=100,left=0,menubar=no,toolbar=no,status=no,scrollbars=no')??
? }?
? window.close();
</script>
</head>
<body>
? ? <input name="button" type="button" onClick="Wopen()" value="點(diǎn)擊我,打開新窗口!" / >
</body>
</html>
2019-11-27
2019-11-27
<script?type=
"text/javascript"
>????
var
?mywin;????
function
?Wopen()?{
????
mywin?=?window.open(
'http://idcbgp.cn'
,?
'_blank'
,?
'width=1000,height=1000,top=100,left=0,menubar=no,toolbar=no,status=no,scrollbars=no'
);????????
????
//setTimeout延遲方法執(zhí)行,延遲5秒????????
????
setTimeout(
mywin.close()
,5000);????????
????
}??????
</script>
2019-10-14
2019-10-14
設(shè)置延遲執(zhí)行的函數(shù):