コードをコピー コードは次のとおりです: JS全画面フローティング広告 <br>div#roll{width:100px;height:100px color:# fff; 位置:絶対 ;}<br> ;/div>私は広告です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.トップ = this.y 'px';<br> <br>this.x = this.x (this.statusX ? -1 : 1)</p>if (this.x if (this.x > this .winW) { this.statusX = 1 }<br> <br>this.y = this.y (this.statusY ? -1 : 1)if (this.y 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>