复制代码 代码如下: JS全屏漂浮广告 <BR>div#roll{width:100px;height:100px; background-color:#000; color:#fff; position:absolute;}<BR> JS全屏漂浮广告,移入光标停止移动·柯乐义 我是广告www.jb51.com <BR>var ggRoll = {<BR>roll: document.getElementById("roll"),<BR>speed: 20,<BR>statusX: 1,<BR>statusY: 1,<BR>x: 100,<BR>y: 300,<BR>winW: document.documentElement.clientWidth - document.getElementById("roll").offsetWidth,<BR>winH: document.documentElement.clientHeight - document.getElementById("roll").offsetHeight,<BR>Go: function () {<BR>this.roll.style.left = this.x + 'px';<BR>this.roll.style.top = this.y + 'px'; <P>this.x = this.x + (this.statusX ? -1 : 1)<BR>if (this.x < 0) { this.statusX = 0 }<BR>if (this.x > this.winW) { this.statusX = 1 } <P>this.y = this.y + (this.statusY ? -1 : 1)<BR>if (this.y < 0) { this.statusY = 0 }<BR>if (this.y > this.winH) { this.statusY = 1 }<BR>}<BR>}<BR>var interval = setInterval("ggRoll.Go()", ggRoll.speed);<BR>ggRoll.roll.onmouseover = function () { clearInterval(interval) };<BR>ggRoll.roll.onmouseout = function () { interval = setInterval("ggRoll.Go()", ggRoll.speed) };<BR>