打开页面后弹出一个带关闭按钮的层,并且在关闭后可以定时弹出的JS。

一种商务通客服弹窗,我只会让他关闭,关闭后就弹不出来了,请大神帮帮忙。下面发出来的是可关闭的。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="ycz/styles/css/tongyong.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="sc_cen" class="swt_cen" style="width:450px; height:270px; position:fixed; top:45%; left:38%; background:url(/swt/images/sc_bj.png) no-repeat center; z-index:999998;">
<div class="sc_zj" style=" width:166px; height:174px; position:absolute; left:21px; bottom:21px; z-index:999999;"><img src="/swt/images/sc_zj.gif" /></div>
<div class="sc_an" style=" width:240px; height:45px; position:absolute; right:21px; bottom:29px; z-index:999999;"><a href="/swt/" target="_blank"><img src="/swt/images/sc_an.gif" /></a></div>
<div class="sc_off" style=" width:29px; height:29px; position:absolute; right:24px; top:24px; z-index:999999;"><a onclick="sc_cen.style.display='none'"><img src="/swt/images/sc_off.png" width="29" height="29" /></a></div>
</div>
</body>
</html>

第1个回答  2015-09-03
用setInterval(fun,time)
fun是你写的触发弹出框的函数,time是间隔的时间,在页面载入的时候先执行一次fun
然后再是setInterval(fun,time),这样就会循环执行了追问

厄, 能详细点吗,我不懂JS...

追答

你可以搜下js弹出层

追问

你能帮我写好发给我吗 我都有搜索过了 看不懂 不会套 = =..

追答

额,你不是要学习吗,给写好了有什么用

追问

厄 我现在是想解决问题.. 麻烦了 跪谢...

追答

好吧,我等会儿回去写吧

追问

厄 谢谢了, 坐等你的答案,我等着用。 头疼了一天了,还是解决不了。

追答

你见到说下你要做的是什么功能吧

追问

大概是这样:
打开网页后弹出一个带关闭按钮的弹窗,关闭后能在指定时间内再次自动弹出。

追答

懂了

追问

坐等大神答案...

追答

私信你了

本回答被提问者和网友采纳
相似回答