- 浏览: 150975 次
- 性别:
- 来自: 株洲
文章分类
最新评论
-
cckfyezi:
上传压缩包不给密码 逗谁玩呢
Spring Quartz 动态设置cronExpression -
samgogo:
密码是多少呀?
xls&xlsx 导入、导出、解析(笔记) -
ls2005nba:
密码是多少呀?
xls&xlsx 导入、导出、解析(笔记) -
liuweihug:
jquery message tooltip告警提示信息展示控 ...
jQuery 消息提示框 -
文昌平蓝杰:
good,万分感谢呀,亲,
在eclipse里编写android代码时很卡,解决方案
以下是js代码
以下是html代码
// JavaScript Document /* ** ================================================================================================== ** 类名:CLASS_MSN_MESSAGE ** 功能:提供类似MSN消息框 ** 示例: --------------------------------------------------------------------------------------------------- var MSG = new CLASS_MSN_MESSAGE("aa",200,120,"短消息提示:","您有1封消息","今天请我吃饭哈"); MSG.show(); --------------------------------------------------------------------------------------------------- ** 作者:ttyp ** 邮件:ttyp@21cn.com ** 日期:2005-3-18 ** ================================================================================================== **/ /* * 消息构造 */ function CLASS_MSN_MESSAGE(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:200; this.height = height?height:120; this.timeout= 150; this.speed = 20; this.step = 1; this.right = screen.width -1; this.bottom = screen.height; this.left = this.right - this.width; this.top = this.bottom - this.height; this.timer = 0; } /* * 隐藏消息方法 */ CLASS_MSN_MESSAGE.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() { 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) } } /* * 消息卸载事件,可以重写 */ CLASS_MSN_MESSAGE.prototype.onunload = function() { return true; } /* * 消息命令事件,要实现自己的连接,请重写它 * */ CLASS_MSN_MESSAGE.prototype.oncommand = function() { window.open(this.action,this.target,''); this.hide(); } /* * 消息显示方法 */ CLASS_MSN_MESSAGE.prototype.show = function() { var oPopup = window.createPopup(); //IE5.5+ this.Pop = oPopup; var w = this.width; var h = this.height; var str = "<DIV style='BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; Z-INDEX: 99999; LEFT: 0px; BORDER-LEFT: #a6b4cf 1px solid; WIDTH: " + w + "px; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP: 0px; HEIGHT: " + h + "px; BACKGROUND-COLOR: #c9d3f3'>" str += "<TABLE style='BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid' cellSpacing=0 cellPadding=0 width='100%' bgColor=#cfdef4 border=0>" str += "<TR>" str += "<TD style='FONT-SIZE: 12px;COLOR: #0f2c8c' width=30 height=24></TD>" str += "<TD style='PADDING-LEFT: 4px; FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: #1f336b; 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: #b9c9ef 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #728eb8 1px solid; PADDING-LEFT: 8px; FONT-SIZE: 12px; PADDING-BOTTOM: 8px; BORDER-LEFT: #728eb8 1px solid; WIDTH: 100%; COLOR: #1f336b; PADDING-TOP: 8px; BORDER-BOTTOM: #b9c9ef 1px solid; HEIGHT: 100%'>" + this.title + "<BR><BR>" str += "<DIV style='WORD-BREAK: break-all' align=left><A href='javascript:void(0)' hidefocus=true id='btCommand'><FONT color=#ff0000>" + 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; 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); //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.hide(); } var btCommand = oPopup.document.getElementById("btCommand"); btCommand.onclick = function() { me.oncommand(); } } /* ** 设置速度方法 **/ CLASS_MSN_MESSAGE.prototype.speed = function(s) { var t = 20; try { t = praseInt(s); } catch(e){} this.speed = t; } /* ** 设置步长方法 **/ CLASS_MSN_MESSAGE.prototype.step = function(s) { var t = 1; try { t = praseInt(s); } catch(e){} this.step = t; } CLASS_MSN_MESSAGE.prototype.rect = function(left,right,top,bottom) { try { this.left = left !=null?left:this.right-this.width; this.right = right !=null?right:this.left +this.width; this.bottom = bottom!=null?(bottom>screen.height?screen.height:bottom):screen.height; this.top = top !=null?top:this.bottom - this.height; } catch(e) {} }
以下是html代码
<html> <head> <script src="message.js"></script> <script> function fun() { //构造对象(id号,宽,高,'标题1','标题2','内容','超链接','打开位置'); var MSG1 = new CLASS_MSN_MESSAGE("aa",200,120,"短消息提示:","您有1封消息","今天请我吃饭哈"); MSG1.rect(null,null,null,screen.height-60); //设置左,右,上,下距离 MSG1.speed = 10; //设置速度方法 MSG1.step = 5; //设置步长方法 MSG1.show(); //显示方法 } </script> </head> <body onLoad="fun()" > </body> </html>
- 消息提示框.rar (2.5 KB)
- 下载次数: 3
发表评论
-
extjs的几个技巧,解决ajax请求时用户session超时问题
2016-05-26 20:34 555来自转载:http://chamcon.iteye.com/b ... -
jQuery Easyui Datagrid相同连续列合并扩展
2015-04-21 16:49 950转载来自:http://www.jeasyuicn.com/j ... -
easyui tree 模仿ztree 使用扁平化加载json
2015-04-13 17:39 2259参考文章:http://www.jeasyuicn.com/d ... -
js 取年月日与年月日加减
2014-03-25 16:27 1336<script language="ja ... -
document.documentElement & e.srcElement &e.target
2013-06-04 17:44 922$(document.documentElement) ... -
session ajax超时问题处理方案
2013-05-12 17:34 1025if (request.getHeader(" ... -
取浏览器版本
2013-01-18 10:16 888<!DOCTYPE HTML PUBLIC &q ... -
变态的时间控件代码
2012-06-21 16:09 964<tr> <td colspan=& ... -
可输入的下拉框
2012-06-12 13:10 744<HTML> <HEAD> & ... -
formValidator ajax 乱码问题
2012-05-16 15:59 1182初次使用formValidator 感 ... -
跨浏览器的CSS固定定位{position:fixed}
2011-11-11 16:39 1049不知道您是否留意了,浏览本站时,浏览器右下角有一个标着top的 ... -
文件上传之图片预览
2011-10-18 15:23 789<!DOCTYPE html PUBLIC &quo ... -
js 的event 个人总结
2011-08-01 17:43 1036event.srcElement.tagName和event. ... -
jQuery cookie 插件
2011-07-29 15:36 851<script type="text/ja ... -
jQuery 图片懒加载技术
2011-07-29 15:05 2484<!--引入以下两个js文件--> ... -
动态加入一段script的引用
2011-05-09 17:30 896<script type="text/j ... -
js 表格排序
2011-03-08 12:04 965<!DOCTYPE HTML PUBLIC &q ... -
火狐与IE中 JS的区别
2011-03-05 00:53 10351. document.form.item 问题 (1)现有 ... -
正则表达式
2011-02-26 11:09 817<script> //中英文混合验证 ... -
会移动的 DIV
2011-02-21 21:44 1041<div id="movediv" ...
相关推荐
js提示框特效js提示框特效js提示框特效js提示框特效js提示框特效
js提示框制作js文字提示框,js图片提示框
鼠标放上去触发一个javascript提示框效果代码鼠标放上去触发一个javascript提示框效果代码鼠标放上去触发一个javascript提示框效果代码鼠标放上去触发一个javascript提示框效果代码鼠标放上去触发一个javascript提示...
自己写了个alert提示框。因为系统alert在苹果手机微信中,提示时,顶部会显示网站地址。 同时其他后续操作需要在js中继续填写。因此简单用div写了一个alert提示框,并自动关闭。 效果图 css样式 /*弹出消息对话框...
非常漂亮的仿QQ界面的JS提示框组件 javascript替换alert提示窗口
title的格式 title="header=[...] body=[...]" 直接打开就可以看到效果,很炫的哦
仿QQ界面的JS提示框组件
对JavaScript中的alert confirm wait 美化,并能返回原来的true false值。
好用的漂亮提示框,比起系统自带的提示框要好看许多,大家可以尝试下
非常漂亮的jquery ajax对话提示框,已做成通用的js库和样式库;非常方便调用,可以操作成功,失败的时候调用,用户体验非常好。 漂亮的js jquery ajax对话提示框
在做B/S开发的时候,通常会遇到很多的客户与服务器的交流,而浏览器自带的弹出工具条是不能修改样式的,用JS模拟一个华丽的工具条逐渐成为这一形式的主流,而这些工具条平时的开发当中重复量很大。JTooltips插件致力...
网页中的提示框在用户交互过程中扮演着非常重要的角色,消息提示框分为警告消息...今天要介绍的这款JavaScript消息提示框的功能非常强大,我们可以通过配置非常轻松的实现各种消息提示框,而且消息框的皮肤也比较漂亮。
一个自动缩放的JS提示框 。
js提示框特效制作多种js提示框效果,如js文字提示框,js图片提示框,js tooltip文字与图片提示框。一款很实用的js提示框插件。
自定义弹出窗口和遮挡层,效果还不错,附带demo实例
1、解决了select的IE6BUG; 2、很好的用的,项目中使用的; 3、可以自己调颜色
非常漂亮的仿QQ界面的JS提示框组件说明
js弹提示框
Js 自定义提示框,几乎没有图片,帅气的提示风格,提示,警示,确认三种提示框
js 浮动提示框js 浮动提示框js 浮动提示框js 浮动提示框js 浮动提示框js 浮动提示框