<!-- 퀵메뉴스크립트 -->
<style type="text/css">
<!--
#floater {position:absolute; visibility:visible}
-->
</style>
<script language="Javascript">
<!--
self.onError=null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0; lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;
<!-- STALKER CODE -->
function heartBeat() {
if(IE) {
diffY = document.body.scrollTop;
diffX = 0;
}
if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
if(diffY != lastScrollY) {
percent = .1 * (diffY - lastScrollY);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.floater.style.pixelTop += percent;
if(NS) document.floater.top += percent;
lastScrollY = lastScrollY + percent;
}
if(diffX != lastScrollX) {
percent = .1 * (diffX - lastScrollX);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.floater.style.pixelRight += percent;
if(NS) document.floater.top += percent;
lastScrollY = lastScrollY + percent;
}
}
if(NS || IE) action = window.setInterval("heartBeat()",1);
//-->
</script>
<!-- 퀵메뉴스크립트여기까지 -->
<!-- 레이어 삽입-->
<div id=floater style="top:140px; width:83px; height:532px; z-index:10"><퀵메뉴></div>
'개발 > javascript Tip' 카테고리의 다른 글
pause 함수 (0) | 2011.12.03 |
---|---|
자바스크립트 팁 (고급 팁) (0) | 2011.12.03 |
엔터치면 다음칸으로 이동 (0) | 2011.12.03 |
아이피 주소인지 아닌지 체크하는 함수 (0) | 2011.12.03 |
상태표시줄 링크 없애기 (0) | 2011.12.03 |