<div class="codetitle"> <span><a style="CURSOR: pointer" data="41935" class="copybut" id="copybut41935" onclick="doCopy('code41935')"><u>코드 복사</u></a></span> 코드는 다음과 같습니다.</div> <div class="codebody" id="code41935"> <br><!--首页图文漂浮开始--> <br><script type="text/javascript" 언어="javascript"> <br>function addEvent(obj, evtType, func, cap) { <br>cap = cap || 거짓; <br>if (obj.addEventListener) { <br>obj.addEventListener(evtType, func, cap); <br>참을 반환합니다. <br>} else if (obj.attachEvent) { <br>if (cap) { <br>obj.setCapture(); <br>참을 반환합니다. <br>} else { <br>return obj.attachEvent("on" evtType, func); <br>} <br>} else { <br>false를 반환합니다. <br>} <br>} <br>function getPageScroll() { <br>var xScroll, yScroll; <br>if (self.pageXOffset) { <br>xScroll = self.pageXOffset; <br>} else if (document.documentElement && document.documentElement.scrollLeft) { <br>xScroll = document.documentElement.scrollLeft; <br>} else if (document.body) { <br>xScroll = document.body.scrollLeft; <br>} <br>if (self.pageYOffset) { <br>yScroll = self.pageYOffset; <br>} else if (document.documentElement && document.documentElement.scrollTop) { <br>yScroll = document.documentElement.scrollTop; <br>} else if (document.body) { <br>yScroll = document.body.scrollTop; <br>} <br>arrayPageScroll = new Array(xScroll, yScroll); <br>arrayPageScroll을 반환합니다. <br>} <br>function GetPageSize() { <br>var xScroll, yScroll; <br>if (window.innerHeight && window.scrollMaxY) { <br>xScroll = document.body.scrollWidth; <br>yScroll = window.innerHeight window.scrollMaxY; <br>} else if (document.body.scrollHeight > document.body.offsetHeight) { <br>xScroll = document.body.scrollWidth; <br>yScroll = document.body.scrollHeight; <br>} else { <br>xScroll = document.body.offsetWidth; <br>yScroll = document.body.offsetHeight; <br>} <br>var windowWidth, windowHeight; <br>if (self.innerHeight) { <br>windowWidth = self.innerWidth; <br>windowHeight = self.innerHeight; <br>} else if (document.documentElement && document.documentElement.clientHeight) { <br>windowWidth = document.documentElement.clientWidth; <br>windowHeight = document.documentElement.clientHeight; <br>} else if (document.body) { <br>windowWidth = document.body.clientWidth; <br>windowHeight = document.body.clientHeight; <br>} <br>if (yScroll < windowHeight) { <BR>pageHeight = windowHeight; <BR>} else { <BR>pageHeight = yScroll; <BR>} <BR>if (xScroll < windowWidth) { <BR>pageWidth = windowWidth; <BR>} else { <BR>pageWidth = xScroll; <BR>} <BR>arrayPageSize = new Array(pageWidth, pageHeight, windowWidth, windowHeight) <BR>return arrayPageSize; <BR>} <br><br>var AdMoveConfig = new Object(); <BR>AdMoveConfig.IsInitialized = false; <BR>AdMoveConfig.ScrollX = 0; <BR>AdMoveConfig.ScrollY = 0; <BR>AdMoveConfig.MoveWidth = 0; <BR>AdMoveConfig.MoveHeight = 0; <BR>AdMoveConfig.Resize = function () { <BR>var winsize = GetPageSize(); <BR>AdMoveConfig.MoveWidth = winsize[2]; <BR>AdMoveConfig.MoveHeight = winsize[3]; <BR>AdMoveConfig.Scroll(); <BR>} <BR>AdMoveConfig.Scroll = function () { <BR>var Winscroll = getPageScroll(); <BR>AdMoveConfig.ScrollX = winscroll[0]; <BR>AdMoveConfig.ScrollY = winscroll[1]; <BR>} <BR>addEvent(window, "resize", AdMoveConfig.Resize); <BR>addEvent(window, "scroll", AdMoveConfig.Scroll); <BR>function AdMove(id) { <BR>if (!AdMoveConfig.IsInitialized) { <BR>AdMoveConfig.Resize(); <BR>AdMoveConfig.IsInitialized = true; <BR>} <BR>var obj = document.getElementById(id); <BR>obj.style.position = "절대"; <BR>var W = AdMoveConfig.MoveWidth - obj.offsetWidth; <BR>var H = AdMoveConfig.MoveHeight - obj.offsetHeight; <BR>var x = W * Math.random(), y = H * Math.random(); <BR>var rad = (Math.random() 1) * Math.PI / 6; <BR>var kx = Math.sin(rad), ky = Math.cos(rad); <BR>var dirx = (Math.random() < 0.5 ? 1 : -1), diry = (Math.random() < 0.5 ? 1 : -1); <BR>var 단계 = 1; <BR>var 간격; <BR>this.SetLocation = 함수(vx, vy) { x = vx; y = vy; } <BR>this.SetDirection = 함수(vx, vy) { dirx = vx; 디리 = vy; } <BR>obj.CustomMethod = function () { <BR>obj.style.left = (x AdMoveConfig.ScrollX) "px"; <BR>obj.style.top = (y AdMoveConfig.ScrollY) "px"; <BR>rad = (Math.random() 1) * Math.PI / 6; <BR>W = AdMoveConfig.MoveWidth - obj.offsetWidth; <BR>H = AdMoveConfig.MoveHeight - obj.offsetHeight; <BR>x = x 단계 * kx * dirx; <BR>if (x < 0) { dirx = 1; x = 0; kx = Math.sin(rad); ky = Math.cos(rad); } <BR>if (x > W) { dirx = -1; x = W; kx = Math.sin(rad); ky = Math.cos(rad); } <BR>y = y 단계 *ky * diry; <BR>if (y < 0) { diry = 1; 와이 = 0; kx = Math.sin(rad); ky = Math.cos(rad); } <BR>if (y > H) { diry = -1; y = H; kx = Math.sin(rad); ky = Math.cos(rad); } <BR>} <BR>this.Run = function () { <BR>var Delay = 10; <BR>interval = setInterval(obj.CustomMethod, 지연); <BR>obj.onmouseover = function () {clearInterval(간격); } <BR>obj.onmouseout = function () { 간격 = setInterval(obj.CustomMethod, 지연); } <BR>} <BR>}<BR></script> <br><!--부동 시작--> <br><DIV id=ad2 style="Z-INDEX: 5;position:relative"> 🎜><a href='PoliceHTk.aspx' target='_blank'><IMG src="images/fudong/fudong.jpg" width="230" height="150" border="0" > </a><br> <a href="#" onclick="document.getElementById('ad2').style.display='none'"> /close1. gif /></a> ; <br><!--부동 끝--> <br></DIV> <br><script type="text/javascript" 언어="javascript"> var ad2 = new AdMove("ad2"); <br>ad2.Run();//여러 부동 소수점 그룹<br><br></script> 그림이 떠 있는 끝 --> <br><br> </div>