<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>MSN 弹出消息框</title>
<script language="javascript" type="text/javascript">
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 = 250;
// 消息停留时间
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;
}
// ---------------------------------------
MessShow.prototype.hide = function()
{
if( this.onunload() )
{
var offset = this.height > this.bottom - this.top ? this.height : this.bottom - this.top;
var me = this;
if( this.timer > 0 )
{
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.offset > 0 )
{
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 )
}
}
// ---------------------------------------
// 消息卸载事件,可以重写
MessShow.prototype.onunload = function()
{
return true;
}
// ---------------------------------------
// 消息命令事件,要实现自己的连接,请重写它
MessShow.prototype.oncommand = function()
{
window.open( this.action, this.target );
this.hide();
}
// ---------------------------------------
// 消息显示方法
MessShow.prototype.show = function()
{
if(msg!= null)
{
msg.innerHTML = "";
msg = null;
delete msg;
CollectGarbage();
}
var oPopup = window.createPopup();
// IE5.5 +
this.Pop = oPopup;
var w = this.width;
var h = this.height;
var str = "<DIV style='BORDER-RIGHT:#005FEE 1px solid; BORDER-TOP:#005FEE 1px solid; Z-INDEX: 99999; LEFT: 0px; BORDER-LEFT:#005FEE 1px solid; WIDTH: " + w + "px; BORDER-BOTTOM:#005FEE 1px solid; POSITION: absolute; TOP: 0px; HEIGHT: " + h + "px; BACKGROUND-COLOR:#FFFFFF'>"
str += "<TABLE style='BORDER-TOP: #FFFFFF 1px solid; BORDER-LEFT: #FFFFFF 1px solid' cellSpacing=0 cellPadding=0 width='100%' bgColor=#FFFFFF border=0>"
str += "<TR>"
str += "<TD style='FONT-SIZE: 12px;COLOR: #0052CC' width=30 height=24>∵</TD>"
str += "<TD style='PADDING-LEFT: 4px; FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR:#0052CC; PADDING-TOP: 4px' vAlign=center width='100%'>" + this.caption + "</TD>"
str += "<TD style='PADDING-RIGHT: 2px; PADDING-TOP: 2px' vAlign=center align=right width=19>"
str += "<SPAN title=关闭 style='FONT-WEIGHT: bold; FONT-SIZE: 12px; CURSOR: hand; COLOR: red; MARGIN-RIGHT: 4px' id='btSysClose' >×</SPAN></TD>"
str += "</TR>"
str += "<TR>"
str += "<TD style='PADDING-RIGHT: 1px;PADDING-BOTTOM: 1px' colSpan=3 height=" + ( h - 28 ) + ">"
str += "<DIV style='BORDER-RIGHT: FFFFFF 1px solid; PADDING-RIGHT: 8px; BORDER-TOP:#66A3FF 1px solid; PADDING-LEFT: 8px; FONT-SIZE: 12px; PADDING-BOTTOM: 8px; BORDER-LEFT:#FFFFFF 1px solid; WIDTH: 100%; COLOR:#FFFFFF; PADDING-TOP: 8px; BORDER-BOTTOM:#FFFFFF 1px solid; HEIGHT: 100%'><FONT color=#EE0000>" + this.title + "</FONT><BR><BR>"
str += "<DIV style='WORD-BREAK: break-all' align=left><A href='javascript:void(0)' hidefocus=true id='btCommand'><FONT color=#EE0000>" + this.message + "</FONT></A></DIV>"
str += "</DIV>"
str += "</TD>"
str += "</TR>"
str += "</TABLE>"
str += "</DIV>"
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.offset > me.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();
}
}
// ---------------------------------------
// 设置速度方法
MessShow.prototype.speed = function( s )
{
var t = 10;
try
{
t = praseInt( s );
}
catch( e )
{
}
this.speed = t;
}
// ---------------------------------------
// 设置步长方法
MessShow.prototype.step = function( s )
{
var t = 2;
try
{
t = praseInt( s );
}
catch( e )
{
}
this.step = t;
}
// ---------------------------------------
MessShow.prototype.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 ? bottom : screen.availHeight;
}
catch( e )
{
}
}
// ---------------------------------------
function load()
{
if (objTime)
{
clearTimeout(objTime);
}
var msg = new MessShow( "hello", 250, 150, "信息", "光之翼,你好!", "QQ:272912705 请求加为好友!", "_bank", 'http://www.baidu.com' );
msg.show();
objTime = setTimeout("load()",2 * 8000);
}
// ---------------------------------------
var objTime = setTimeout("load()",2000);
</script>
</head>
<body >
<form id="form1">
<div>
</div>
</form>
</body>
</html>
功能强大的弹出窗口提示,提示内容可更改
这是以前做一个OA的提示信息时找到的,和大家来分享下
if(msg!= null)
{
msg.innerHTML = "";
msg = null;
delete msg;
CollectGarbage();
}
是我自己改的,因为发现如果定时弹出时(弹出内容很多)
多次后IE所占用的内存会一直增加,加上后内存增加的速度减小了很多 不过还不能控制它增加,哪位有办法解决大家分享下
分享到:
相关推荐
ASP.NET版 仿QQ MSN 右下角 弹出窗口 提示小窗口 控件仿MSN右下角的弹出窗口控件,实际上不仅仅局限于右下角,网页的其它地方都可以用,这是Asp.net修正版。 源代码中包括C#、VB.net两种代码的示例,以及控件源...
动画方式弹出,就像MSN的提示框 2:漂亮,详细见配图 3:还可以再在开一个更加详细的内容网页 4:自动关闭,无需手工确认那个ok 5:示例包括C#和VB两个版本,popUp的源文件在Source文件夹中 6:用起来...
运行环境vs2005 1:动画方式弹出,就像MSN的提示框 2:漂亮,详细见配图 3:还可以再在开一个更加详细的内容网页 4:自动关闭,无需手工确认那个ok
在网页中实现类似MSN弹出式消息窗口,很漂亮实用!
内容索引:.NET源码,控件组件,右下角,弹出窗口 仿MSN右下角的弹出窗口控件,实际上不仅仅局限于右下角,网页的其它地方都可以用,修正版。 源代码中包括C#、两种代码的示例,以及控件源代码。 它可以像动画一样...
带视频的网页可调整大小的皮肤
内容索引:脚本资源,Ajax/JavaScript,弹出层,Dialog,右下角 msgWin 一款仿MSN多风格的网页右下角滑出窗口,有不同的颜色,不同的窗口样式,窗口大小也可以调整的,一个JS类已经封装,调用非常方便,部分效果可以看...
4:开机5分钟后自动弹出程序窗口。(类似于QQ,MSN弹窗) 5:程序底部有一个状态栏,用于显示系统是否连接到互联网。 6:如果连接到互联网,则调用网上指定的网页。没有连网,则显示最后一次联网的时候所显示的页面。...
内容索引:脚本资源,Ajax/JavaScript,仿MSN,弹出窗口 JavaScript仿MSN右下角窗口简洁版代码,大家经常见到的功能,打开网页后显示在浏览器的右下角位置,有的可以定时,自动关闭,要么是手动关闭,广泛应用到公告、...
可以弹出窗口的长宽为条件进行拦截,引入了“统一数据文件”和“程序集”的概念,为CuteIE的功能扩充提供了一个便捷、灵活的框架最近更新: 增加程序集:记事本 一些编辑页面,可通过快捷键"Ctrl+S",进行保存。...
12.18 幻灯片式弹出窗口 12.19 弹出窗口生成器 12.20 关不掉的警告框 12.21 循环的警告框 12.22 屏蔽状态栏的错误提示 12.23 获取模式窗口的值 第13章 日期和时间特效 13.1 指定时间关闭页面 13.2 最简单的时间日期...
12.18 幻灯片式弹出窗口 12.19 弹出窗口生成器 12.20 关不掉的警告框 12.21 循环的警告框 12.22 屏蔽状态栏的错误提示 12.23 获取模式窗口的值 第13章 日期和时间特效 13.1 指定时间关闭页面 13.2 最简单的时间日期...
53:关闭弹出两窗口的代码下载 54:鼠标经过即弹出广告代码下载 55:按钮跳出广告代码下载 56:左边底部悬浮代码下载 57:滑动展开/收缩广告代码下载 58:点空白页面也弹出代码下载 59:置顶收栏关闭效果代码下载 60:...
网站广告功能 - 具有页内广告、浮动广告、弹出窗口、对联广告、轮播广告等多种形式 友情链接功能 - 支持文本和图片链接 在线编辑模板 - 通过后台设置模版中文插件的显示参数 背景音乐功能 - 通过输入音乐地址即可给...
网站广告系统 - 具有轮播广告、页内广告、浮动广告、弹出窗口、挂角广告等多种形式 访问统计系统 - 网页访问统计分析 邮件群发系统 - 邮件组设置,会员邮件群发 投票调查系统 - 设置投票组,任意插入模版 ...
1、浏览器:多页面浏览、鼠标手势、鼠标拖拽、页面缩放、浮动广告过滤、弹出窗口过滤、增强的收藏夹、历史、简单明快的外观主题 2、信息助理:RSS阅读器、统一登录、音乐盒、资料库、天气预报、日记本、记事本、...
1、浏览器:多页面浏览、鼠标手势、鼠标拖拽、页面缩放、浮动广告过滤、弹出窗口过滤、增强的收藏夹、历史、简单明快的外观主题 2、信息助理:RSS阅读器、统一登录、音乐盒、资料库、天气预报、日记本、记事本、...
发送邮件成功或失败弹出窗口、声音提示 从游戏画面切换回来后最小化隐藏的界面出来了的问题 UI细节的改进,默认UI风格改为office2003 密送其他人看到邮件地址的问题 地址本窗口打开后闪动的问题 CSV文件导入地址本的...
53:关闭弹出两窗口的代码下载 54:鼠标经过即弹出广告代码下载 55:按钮跳出广告代码下载 56:左边底部悬浮代码下载 57:滑动展开/收缩广告代码下载 58:点空白页面也弹出代码下载 59:置顶收栏关闭效果代码下载 60:...