首頁 > web前端 > js教程 > 短信提示使用 特效_典型特效

短信提示使用 特效_典型特效

WBOY
發布: 2016-05-16 19:20:41
原創
1070 人瀏覽過

复制代码 代码如下:

<script> <BR><!-- <BR>window.onload = getMsg; <BR>window.onresize = resizeDiv; <BR>window.onerror = function(){} <BR>//短信提示使用 <BR>var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0; <BR>function getMsg() <BR>{ <BR> try{ <BR> divTop = parseInt(document.getElementById("eMeng").style.top,10) <BR> divLeft = parseInt(document.getElementById("eMeng").style.left,10) <BR> divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10) <BR> divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10) <BR> docWidth = document.body.clientWidth; <BR> docHeight = document.body.clientHeight; <BR> document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight <BR> document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth <BR> document.getElementById("eMeng").style.visibility="visible" <BR> objTimer = window.setInterval("moveDiv()",10) <BR> } <BR> catch(e){} <BR>} <br><br>function resizeDiv() <BR>{ <BR> i+=1 <BR> if(i>600) closeDiv() //客户想不用自动消失由用户来自己关闭所以屏蔽这句 <BR> try{ <BR> divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10) <BR> divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10) <BR> docWidth = document.body.clientWidth; <BR> docHeight = document.body.clientHeight; <BR> document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10) <BR> document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10) <BR> } <BR> catch(e){} <BR>} <br><br>function moveDiv() <BR>{ <BR> try <BR> { <BR> if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10))) <BR> { <BR> window.clearInterval(objTimer) <BR> objTimer = window.setInterval("resizeDiv()",1) <BR> } <BR> divTop = parseInt(document.getElementById("eMeng").style.top,10) <BR> document.getElementById("eMeng").style.top = divTop - 1 <BR> } <BR> catch(e){} <BR>} <BR>function closeDiv() <BR>{ <BR> document.getElementById('eMeng').style.visibility='hidden'; <BR> if(objTimer) window.clearInterval(objTimer) <BR>} <BR>--> <BR></script>
相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
最新問題
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板