<head>와</head>사이에 아래 소스를 넣습니다.
<style type="text/css">
<!--
#floater {
position:absolute;
visibility: visible;
}
-->
</style>
다음에는 <body></body> 사이에 퀵메뉴를 넣어줄 셀 안에 넣어주세요.
내용넣기 부분에는 퀵메뉴를 넣어주면 됩니다.
사이즈는 본인에게 맞게 수정해서 사용하세요.
<div id=floater style=" top:120; width:100; height:100; z-index:10; position;relative">
내용넣기
</div>
<script language="javascript">
var scrollStat = true;
position_start = 0;
lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1 : 0;
OP = ((document.getElementById) && (navigator.appName == "Opera")) ? 1 : 0;
NSSECHS = ((document.getElementById) && (navigator.appName == "Netscape")) ? 1 : 0;
if (IE) {
position = document.all.floater.style.pixelTop;
}
if (OP) {
position = document.getElementById("floater").style.pixelTop;
}
if (NS) {
position_start = 15;
position = document.floater.top;
}
function abstand()
{
if ( scrollStat == false ) return;
if (IE) { diffY = document.body.scrollTop; }
if (NS) { diffY = self.pageYOffset; }
if (OP) { diffY = document.getElementsByTagName("body") [0] .scrollTop; }
if (diffY != lastScrollY) {
percent = .1 * (diffY - lastScrollY);
if (percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if (IE) {
position += percent;
document.all.floater.style.pixelTop = position + position_start ;
if (document.all.floater.style.pixelTop < 50){
document.all.floater.style.pixelTop = 50;
}
}
if (OP) {
position += percent;
document.getElementById("floater").style.PixelTop = position + position_start;
}
if (NS) {
position += percent;
document.floater.top = position + position_start;
}
lastScrollY = lastScrollY + percent;
}
}
if (NS || IE || OP ) action = window.setInterval("abstand()",1);
</script>
============================
위 파일 인클루드 시키고..
div id 명은 floater로 position : absolute 지정
크기는 css 가 아닌 div 내 태그로 지정 그럼 끗~!
'작업공간 > Web Programming' 카테고리의 다른 글
마우스오버 레이어 상태 변경 (0) | 2009.09.29 |
---|---|
css P 태그- 라인 한줄로 (0) | 2009.09.02 |
자바스크립트 명령어 참조 (0) | 2009.05.18 |
archive.org 로 찾아본 내 옛날 홈페이지들 (1) | 2009.05.02 |
[홈페이지] 성균관대학교 기계재료 연구실 (1) | 2009.05.02 |