飘窗代码,自己补充了一下
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> <style type="text/css"> #flow{ LEFT: 10px; WIDTH: 200px; POSITION: absolute; TOP: 147px; HEIGHT: 163px; /*background-color: #EFEFEF;*/ /*background-color:#7EF030;*/ border: 1px none #000000; } </style> <body> <!--悬浮--> <div id="flow" onMouseOver="stop()" onMouseOut="start()"> <!--这里是内容--> <table width=90> <tbody> <tr> <td><IMG src="../images/logo1.png" border=0></td> </tr> <tr> <td> <div align=right><a onclick="stopAd()">关闭 </a></div> </td> </tr> </tbody> </table> </div> <!--------------------> <!--浮动飘窗代码--> <script type="text/javascript"> var xPos = 50; var yPos = 60; var step = 1; var delay =100; var height = 0; var Hoffset = 0; var Woffset = 0; var yon = 0; var xon = 0; var interval; flowE=document.getElementById("flow"); flowE.style.top = yPos+"px"; function changePos() { width = document.documentElement.clientWidth; height = document.documentElement.clientHeight; Hoffset = flowE.offsetHeight; Woffset = flowE.offsetWidth; flowE.style.left = (xPos + document.body.scrollLeft)+"px"; flowE.style.top = (yPos + document.body.scrollTop)+"px"; // ////////////////////////////////////////////////////////////////////////////// yon==0?yPos+=step:yPos-=step; xon==0?xPos-=step:xPos+=step; if(xPos>=(width-Woffset)){ xPos=(width-Woffset); xon=0; } else if(xPos<=0){ xPos=0; xon=1; } if(yPos>=(height-Hoffset)) { yPos = (height - Hoffset); yon=1; } else if(yPos<=0){ yPos =0; yon=0; } //////////////////////////////////////////////////////////////////////////////////////////////////////// } <!--关闭浮动飘窗--> function stopAd(){ flowE.style.display = 'none'; clearInterval(interval); } <!--这里是自己家的,点击底部的关闭,该div消失代码--> function start() {interval = setInterval('changePos()', delay); } function stop(){clearInterval(interval);} start(); </script> </body> </html>
自己一步一步走来,想周五怎么办呢?周五尴尬时刻啊!
所有故事 都会有一个答案,所有的答案 并不如最初所愿