-

- 加为好友
- 发送私信
- 在线聊天
|
| 发表于:2008-07-21 18:38:30 楼主 |
晕死 弄了一下午 怎么也不行 大家帮看看 一个右下角仿qq msn的信息提示 在html里面一点问题也没有 但在vs里面就不能随着滚动条动也跟着往上走 代码如下 <Script language="javascript"> <!-- window.onload = getMsg; window.onresize = resizeDiv; window.onerror = function(){} //短信提示使用(asilas添加) 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>1300) 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> <DIV id=eMeng4 style="BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; Z-INDEX:99999; LEFT: 0px; VISIBILITY: hidden; BORDER-LEFT: #a6b4cf 1px solid; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP: 0px; BACKGROUND-COLOR: #c9d3f3; "> <TABLE WIDTH=300 BORDER=0 CELLPADDING=0 CELLSPACING=0> <TR> <TD COLSPAN=3 background="img/adsp_01.jpg" bgcolor="#ECE9D8"> <div align="center"> <span class="STYLE1" onclick=closeDiv()>关闭 </span> </span> </div> </TD> <TD> <IMG SRC="img/spacer.gif" WIDTH=1 HEIGHT=25 ALT=""> </TD> </TR> <TR> <TD> <IMG SRC="img/adsp_02.jpg" WIDTH=18 HEIGHT=217 ALT=""> </TD> <TD ROWSPAN=2> <script type="text/javascript"> var swf_width=284 var swf_height=222 var texts='百盛电脑总代理 LED ¦百盛电脑总代理 SONY ¦百盛电脑总代理 联想笔记本' var files='/video/led.flv ¦/video/sony.flv ¦/video/lenovo.flv' var flvPlayUrl = "123.swf"; document.write(' <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">'); document.write(' <param name="movie" value="'+flvPlayUrl+'"> <param name="quality" value="high">'); document.write(' <embed src=\"'+flvPlayUrl+'\" wmode=\"opaque\" quality=\"high\" width=\"'+ swf_width +'\" height=\"'+ swf_height +'\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />'); document.write(' </object>'); </script> <TD> <IMG SRC="img/adsp_04.jpg" WIDTH=18 HEIGHT=217 ALT=""> </TD> <TD> <IMG SRC="img/spacer.gif" WIDTH=1 HEIGHT=217 ALT=""> </TD> </TR> <TR> <TD ROWSPAN=2> <IMG SRC="img/adsp_05.jpg" WIDTH=18 HEIGHT=28 ALT=""> </TD> <TD ROWSPAN=2> <IMG SRC="img/adsp_06.jpg" WIDTH=18 HEIGHT=28 ALT=""> </TD> <TD> <IMG SRC="img/spacer.gif" WIDTH=1 HEIGHT=5 ALT=""> </TD> </TR> <TR> <TD> <IMG SRC="img/adsp_07.jpg" WIDTH=284 HEIGHT=23 ALT=""> </TD> <TD> <IMG SRC="img/spacer.gif" WIDTH=1 HEIGHT=23 ALT=""> </TD> </TR> </TABLE> </DIV> |
|
|
|
40
修改
删除
举报
引用
回复
| |