用户名:
密 码:
用户注册
网站封面设计
共享功能管理
网站管理
在线编辑器
栏目管理
多国语言设置
上传备案证书

展示窗口后自动关闭

点击数:         
打印本页 收藏 关闭 【字号

(建购物网站就到山石网站自选超市)

代码:

<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网页特效代码|JsCode.CN|---展示窗口后自动关闭</title>

<SCRIPT>
<!--

var flyingwin
var popupwidth=200
var popupheight=150
var marginright
var windowcenter
var i_top=200
var i_left=-popupwidth-50
var step=40
var timer
var waitingtime=2000 //时间为两秒
var pause=20

function showWindow() {
 flyingwin = window.open("", "flyingwin", "toolbar=no,width="+popupwidth+",height="+popupheight+",top=100,left="+(-popupwidth)+"");
 flyingwin.document.open();
 flyingwin.document.write("<html><title>漂浮的窗口</title><body><p align=center>请不要关闭窗口,我立马滚蛋!</body></html>");
 flyingwin.document.close();
 
 if (document.all) {
  marginright = screen.width+50
 }
 if (document.layers) {
  marginright = screen.width+50
 }
 windowcenter=Math.floor(marginright/2)-Math.floor(popupwidth/2)
 movewindow()
  
}

function movewindow() {
  if (i_left<=windowcenter) {
   flyingwin.moveTo(i_left,i_top)
   i_left+=step
   timer= setTimeout("movewindow()",pause)
  }
  else {
   clearTimeout(timer)
   timer= setTimeout("movewindow2()",waitingtime)
  }
}

function movewindow2() {
  if (i_left<=marginright) {
   flyingwin.moveTo(i_left,i_top)
   i_left+=step
   timer= setTimeout("movewindow2()",pause)
  }
  else {
   clearTimeout(timer)
   flyingwin.close()
  }
}

// -->
</SCRIPT>
</head>

<BODY onload=showWindow()>

</body>

</html>




评分                    
表情              
*内容:
*验证码
 
    地址:黑龙江省哈尔滨市南岗区文库街16号智力大厦208室   邮编:150040
    业务咨询办理:0451-89060603、013945010420 电话总机:0451-86230075 86230073 传真:转分机608