当前位置: 首页 > 图文教程 > 网络编程 > Javascript > 短信提示使用 特效

Javascript
Web层改进II-用xmlhttp 无声息提交复杂表单
用ADODB.Stream转换
html读出文本文件内容
自适应高度框架 ----属个人收藏内容
Maps Javascript
JAVASCRIPT HashTable
一页面多XMLHttpRequest对象
网页javascript精华代码集
判断浏览器的js代码
JS判断浏览器之Navigator对象
用js自动判断浏览器分辨率的代码
用JavaScript和注册表脚本实现右键收藏Web页选中文本
判断页面是关闭还是刷新的js代码
WebGame《逆转裁判》完整版 代码下载(1月24日更新)
叠加计算出错的解决方法
一个轻量级的XHTML右键菜单[支持IE和firefox]
一些易混淆且不常用的属性,希望有用
网易首页的新闻代码
Flash对联广告的关闭按钮讨论
用JS获得表格当前行数的代码

Javascript 中的 短信提示使用 特效


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 93 ::
收藏到网摘: n/a

复制代码 代码如下:

<SCRIPT language=JavaScript>
<!--
window.onload = getMsg;
window.onresize = resizeDiv;
window.onerror = function(){}
//短信提示使用
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
function getMsg()
{
try{
divTop = parseInt(document.getElementById("eMeng").style.top,10)
divLeft = parseInt(document.getElementById("eMeng").style.left,10)
divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight
document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth
document.getElementById("eMeng").style.visibility="visible"
objTimer = window.setInterval("moveDiv()",10)
}
catch(e){}
}
function resizeDiv()
{
i+=1
if(i>600) closeDiv() //客户想不用自动消失由用户来自己关闭所以屏蔽这句
try{
divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)
document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10)
}
catch(e){}
}
function moveDiv()
{
try
{
if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
{
window.clearInterval(objTimer)
objTimer = window.setInterval("resizeDiv()",1)
}
divTop = parseInt(document.getElementById("eMeng").style.top,10)
document.getElementById("eMeng").style.top = divTop - 1
}
catch(e){}
}
function closeDiv()
{
document.getElementById('eMeng').style.visibility='hidden';
if(objTimer) window.clearInterval(objTimer)
}
-->
</SCRIPT>