지구인

간단한 퀵메뉴

· 19년 전 · 3960
퀵메뉴 관련소스 중에 비교적 간단해서 자주 애용하는 소스입니다. (중복일지도;;)
근데 아쉽게도 파폭에선 안되네요... 그동안 잘 안 쓴 이유도 그때문인데 그럼에도 불구하고 오늘 어떤 사이트에 적용했다가 (찾아보니 다른건 거의 플래시용이라) 팁으로도 올립니다.

그누에 적용하시려면 아래 소스를 따로 /g4/js/qmenu.js 등의 이름으로 저장한 다음
head.sub.php에서

<script language="javascript" src="<?=$g4['path']?>/js/common.js"></script>
<script language="javascript" src="<?=$g4['path']?>/js/ajax.js"></script>
<script language="javascript" src="<?=$g4['path']?>/js/qmenu.js"></script>
<body topmargin="0" leftmargin="0" <?=isset($g4['body_script']) ? $g4['body_script'] : "";?>>
<a name="g4_head"></a>

이런 식으로 추가해주면 됩니다.


///////////////여기부터 퀵메뉴 소스
document.write('<div id=floater style=\"position:absolute; left:1000px; top:300px; z-index:100;\">');
document.write('<a href=\"#g4_head\" onfocus="this.blur()">Top</a><br>');
document.write('<a href=\"javascript:history.go(-1)\" onfocus="this.blur()">Back</a></div>');

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.pixelLeft += percent;
if(NS) document.floater.top += percent;
lastScrollY = lastScrollY + percent;
}
}
if(NS || IE) action = window.setInterval("heartBeat()",1);
////////////여기까지<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
18년 전 조회 5,904
18년 전 조회 6,998
18년 전 조회 2,479
18년 전 조회 2,723
19년 전 조회 4,183
19년 전 조회 2,187
19년 전 조회 3,631
19년 전 조회 2,886
19년 전 조회 2,747
19년 전 조회 2,214
19년 전 조회 2,477
19년 전 조회 2,603
19년 전 조회 3,101
19년 전 조회 3,750
19년 전 조회 3,286
19년 전 조회 2,794
19년 전 조회 2,288
19년 전 조회 2,956
19년 전 조회 3,048
19년 전 조회 2,555
19년 전 조회 2,312
19년 전 조회 3,343
19년 전 조회 4,866
19년 전 조회 5,082
19년 전 조회 2,304
19년 전 조회 2,196
19년 전 조회 5,007
19년 전 조회 8,978
19년 전 조회 2,058
19년 전 조회 4,937
19년 전 조회 4,378
19년 전 조회 2,617
19년 전 조회 4,975
19년 전 조회 2,803
19년 전 조회 3,678
19년 전 조회 2,631
19년 전 조회 3,446
19년 전 조회 1,962
19년 전 조회 5,392
19년 전 조회 1,710
19년 전 조회 6,062
19년 전 조회 2,884
19년 전 조회 6,049
19년 전 조회 6,845
19년 전 조회 3,738
19년 전 조회 2,217
19년 전 조회 2,109
19년 전 조회 6,909
19년 전 조회 2,408
19년 전 조회 3,961
19년 전 조회 5,347
19년 전 조회 2,692
19년 전 조회 1,746
19년 전 조회 1,589
19년 전 조회 1,528
19년 전 조회 1,805
19년 전 조회 1,800
19년 전 조회 1,793
19년 전 조회 1,729
19년 전 조회 2,521
19년 전 조회 2,322
19년 전 조회 3,476
19년 전 조회 2,608
19년 전 조회 2,583
19년 전 조회 3,429
19년 전 조회 4,642
19년 전 조회 2,979
19년 전 조회 2,813
19년 전 조회 3,363
19년 전 조회 6,293
19년 전 조회 2,198
19년 전 조회 2,002
19년 전 조회 1,952
19년 전 조회 2,013
19년 전 조회 3,205
19년 전 조회 2,273
19년 전 조회 1,961
19년 전 조회 1,641
19년 전 조회 2,087
19년 전 조회 3,373
19년 전 조회 3,242
19년 전 조회 1,916
19년 전 조회 1,494
19년 전 조회 3,193
19년 전 조회 2,062
19년 전 조회 1,630
19년 전 조회 2,845
19년 전 조회 1,980
19년 전 조회 1,851
19년 전 조회 1,827
19년 전 조회 1,792
19년 전 조회 2,213
19년 전 조회 2,638
19년 전 조회 1,797
19년 전 조회 1,532
19년 전 조회 1,542
19년 전 조회 1,471
19년 전 조회 3,235
19년 전 조회 2,924
19년 전 조회 1,681