글 수 300
2006.06.03 21:38:20 (*.182.122.164)
17678
<script language=javascript>
<!--
var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
function getRef(id) {
if (isDOM) return document.getElementById(id);
if (isIE4) return document.all[id];
if (isNS4) return document.layers[id];
}
var isNS = navigator.appName == "Netscape";
function moveRightEdge() {
var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;
if (isNS4) {
yMenuFrom = divMenu.top;
yMenuTo = windows.pageYOffset + 405; // 위쪽 위치
} else if (isDOM) {
yMenuFrom = parseInt (divMenu.style.top, 10);
yMenuTo = (isNS ? window.pageYOffset +405 : document.body.clientHeight + document.body.scrollTop - 45 ); // 위쪽 위치
if(!isNS) {
if( yMenuTo > document.body.scrollHeight - 250 ) yMenuTo = document.body.scrollHeight - 235;
if( yMenuTo < 65 ) yMenuTo = 65;
}
}
timeoutNextCheck = 500;
if (yMenuFrom != yMenuTo) {
yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 10);
if (yMenuTo < yMenuFrom)
yOffset = -yOffset;
if (isNS4)
divMenu.top += yOffset;
else if (isDOM)
divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
timeoutNextCheck = 10;
}
setTimeout ("moveRightEdge()", timeoutNextCheck);
}
//-->
</script>
<a href="#top" onFocus="blur()">
<img id=divMenu style="left: 880; top:260; visibility: visible; width: 13px; position: absolute" src="탑버튼 이미지경로" border="0" height="33"></a>
<script language=javascript>
<!--
if (isNS4) {
var divMenu = document["divMenu"];
divMenu.top = windows.pageYOffset + 405;
divMenu.visibility = "visible";
moveRightEdge();
} else if (isDOM) {
var divMenu = getRef('divMenu');
divMenu.style.top = (isNS ? window.pageYOffset +405 : document.body.clientHeight + document.body.scrollTop - 45 );
if(!isNS) {
if( divMenu.style.top > document.body.scrollHeight - 250 ) divMenu.style.top = document.body.scrollHeight - 235;
if( divMenu.style.top < 65 ) divMenu.style.top = 65;
}
divMenu.style.visibility = "visible";
moveRightEdge();
}
//-->
</script>
<!--TOP버튼 끝-->
<!--
var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
function getRef(id) {
if (isDOM) return document.getElementById(id);
if (isIE4) return document.all[id];
if (isNS4) return document.layers[id];
}
var isNS = navigator.appName == "Netscape";
function moveRightEdge() {
var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;
if (isNS4) {
yMenuFrom = divMenu.top;
yMenuTo = windows.pageYOffset + 405; // 위쪽 위치
} else if (isDOM) {
yMenuFrom = parseInt (divMenu.style.top, 10);
yMenuTo = (isNS ? window.pageYOffset +405 : document.body.clientHeight + document.body.scrollTop - 45 ); // 위쪽 위치
if(!isNS) {
if( yMenuTo > document.body.scrollHeight - 250 ) yMenuTo = document.body.scrollHeight - 235;
if( yMenuTo < 65 ) yMenuTo = 65;
}
}
timeoutNextCheck = 500;
if (yMenuFrom != yMenuTo) {
yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 10);
if (yMenuTo < yMenuFrom)
yOffset = -yOffset;
if (isNS4)
divMenu.top += yOffset;
else if (isDOM)
divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
timeoutNextCheck = 10;
}
setTimeout ("moveRightEdge()", timeoutNextCheck);
}
//-->
</script>
<a href="#top" onFocus="blur()">
<img id=divMenu style="left: 880; top:260; visibility: visible; width: 13px; position: absolute" src="탑버튼 이미지경로" border="0" height="33"></a>
<script language=javascript>
<!--
if (isNS4) {
var divMenu = document["divMenu"];
divMenu.top = windows.pageYOffset + 405;
divMenu.visibility = "visible";
moveRightEdge();
} else if (isDOM) {
var divMenu = getRef('divMenu');
divMenu.style.top = (isNS ? window.pageYOffset +405 : document.body.clientHeight + document.body.scrollTop - 45 );
if(!isNS) {
if( divMenu.style.top > document.body.scrollHeight - 250 ) divMenu.style.top = document.body.scrollHeight - 235;
if( divMenu.style.top < 65 ) divMenu.style.top = 65;
}
divMenu.style.visibility = "visible";
moveRightEdge();
}
//-->
</script>
<!--TOP버튼 끝-->
<head>
소스
</head>
이렇게 넣으시고 소스 중간에 보면
<a href="#top" onFocus="blur()">
<img id=divMenu style="left: 880; top:260; visibility: visible; width: 13px; position: absolute" src="탑버튼 이미지경로" border="0" height="33"></a>
이 부분에서 top버튼 이미지 만들어서 서버에 올린 경로 입력해주고..
버튼이 보이는 위치는 left:숫자 top:숫자 <-이 부분을 조절하시면 됩니다.
그리고 width: 13px; <-이건 빼도 상관없습니다. 크기 지정 안해주면 top버튼 원래 크기 그대로 가니까요.