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

Javascript
JavaScript Break 和 Continue区别教程
JavaScript 特殊字符
JavaScript 指导方针
JavaScript进阶教程(第四课第一部分)
JavaScript初级教程(第一课)
JavaScript初级教程(第五课续)
JavaScript进阶教程(第一课)
JavaScript进阶教程(第二课)
JavaScript进阶教程(第二课续)
JavaScript进阶教程(第三课)
JavaScript进阶教程(第三课第二部分)
setTimeout在类中使用的问题!
如何解决attachEvent函数时,this指向被绑定的元素的问题?
js检测客户端不是firefox则提示下载
在页面上点击任一链接时触发一个事件的代码
仿豆瓣分页原型(Javascript版)
javascript表格控件:Chgrid,简化型
收集的网上用的ajax之chat.js文件
给网站上的广告“加速”显示的方法
在JavaScript中通过URL传递汉字的方法

Javascript 中的 短信提示使用 特效


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 169 ::
收藏到网摘: 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>