코드 복사 코드는 다음과 같습니다. JS 전체 화면 플로팅 광고 <br>div#roll{width:100px;height:100px color:# fff; 위치:절대 ;}<br> ;/div>나는 광고입니다www.jb51.com <br>var ggRoll = {<br>roll: document.getElementById("roll"),<br>속도: 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';<br> <br>this.x = this.x (this.statusX ? -1 : 1)</p>if (this.x < 0) { this.statusX = 0 }<P>if (this.x > this .winW) { this.statusX = 1 }<br> <br>this.y = this.y (this.statusY ? -1 : 1)if (this.y < 0) { this.statusY = 0 }<P>if (this.y > this .winH) { this.statusY = 1 }<br>}<br>}<br>var 간격 = setInterval("ggRoll.Go()", ggRoll.speed);<br>ggRoll.roll.onmouseover = 함수( ) {clearInterval(간격) };<br>ggRoll.roll.onmouseout = function () { 간격 = setInterval("ggRoll.Go()", ggRoll.speed) };<br>