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

Javascript
javascript 汉字与拼音转换
JavaScript使用cookie
大平洋汽车网左侧菜单
使用JS操作页面表格,元素的一些技巧
分享我学习js的过程 作者aircy javascript学习教程
张孝祥JavaScript学习阶段性总结(2)--(X)HTML学习
用js来生成随机彩票号码清单
发一个数据过滤的代码,很简单,有用的着的拿去
如何在标题栏显示框架内页面的标题
js滚动条多种样式,推荐
再次更新!MSClass (Class Of Marquee Scroll通用不间断滚动JS封装类 Ver 1.6)
符合web标准的连续滚动图像的js代码
使用iframe作为日历的载体,不再被select和flash等控件挡住的日期输入框
通过脚本控制指定内容不能被选择
模拟弹出窗口效果,关闭层之前,不能选择后面的页内容
另类弹出窗口,跳过所有拦截工具
使用prototype.js进行异步操作
JS模拟多线程
动态增加/删除文件域
[分享]一个非常漂亮的进度滚动条

Javascript 中的 短信提示使用 特效


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