Js弹出淡入淡出消息框.doc_第1页
Js弹出淡入淡出消息框.doc_第2页
Js弹出淡入淡出消息框.doc_第3页
Js弹出淡入淡出消息框.doc_第4页
免费预览已结束,剩余1页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Js弹出淡入淡出消息框源码 MSN 弹出消息框function MessShow(id,width,height,caption,title,message,target,action) this.id = id; this.title = title; this.caption = caption; this.message = message; this.target = target; this.action = action; this.width = width?width:250; this.height = height?height:150; this.timeout = 1000; /消息停留时间 this.speed = 10; /消息速度,越小越快 this.step = 2; /移动步长 this.right = screen.width -1; this.bottom = screen.height; this.left = this.right - this.width; this.top = this.bottom - this.height; this.timer = 0; this.pause = false; this.close = false; this.autoHide = true;MessStotype.hide = function() if(this.onunload() var offset = this.heightthis.bottom-this.top?this.height:this.bottom-this.top; var me = this; if(this.timer0) window.clearInterval(me.timer); var fun = function() if(me.pause=false|me.close) var x = me.left; var y = 0; var width = me.width; var height = 0; if(me.offset0) height = me.offset; y = me.bottom - height; if(y=me.bottom) window.clearInterval(me.timer); me.Pop.hide(); else me.offset = me.offset - me.step; me.Pop.show(x,y,width,height); this.timer = window.setInterval(fun,this.speed) /消息卸载事件,可以重写MessStotype.onunload = function() return true; / 消息命令事件,要实现自己的连接,请重写它 MessStotype.oncommand = function() window.open(this.action,this.target); this.hide(); / 消息显示方法 MessStotype.show = function() var oPopup = window.createPopup(); /IE5.5+ this.Pop = oPopup; var w = this.width; var h = this.height; var str = str += str += str += str += + this.caption + str += str += str += str += str += str += + this.title + str += + this.message + str += str += str += str += str += oPopup.document.body.innerHTML = str; this.offset = 0; var me = this; oPopup.document.body.onmouseover = function()me.pause=true; oPopup.document.body.onmouseout = function()me.pause=false; var fun = function() var x = me.left; var y = 0; var width = me.width; var height = me.height; if(me.offsetme.height) height = me.height; else height = me.offset; y = me.bottom - me.offset; if(y=me.top) me.timeout-; if(me.timeout=0) window.clearInterval(me.timer); if(me.autoHide) me.hide(); else me.offset = me.offset + me.step; me.Pop.show(x,y,width,height); this.timer = window.setInterval(fun,this.speed) var btClose = oPopup.document.getElementById(btSysClose); btClose.onclick = function() me.close = true; me.hide(); var btCommand = oPopup.document.getElementById(btCommand); btCommand.onclick = function() me.oncommand(); / 设置速度方法MessStotype.speed = function(s) var t = 10; try t = praseInt(s); catch(e) this.speed = t;/ 设置步长方法MessStotype.step = function(s) var t = 2; try t = praseInt(s); catch(e) this.step = t; MessStotype.rect = function(left,right,top,bottom) try this.left = left?left:0; this.right = right?right:screen.availWidth -1; this.top = top?top:0; this.bottom = bottom?botto

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论