스크롤 퀵메뉴 크로스 브라우징 소스
페이지 정보
작성자 오원장쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 댓글 0건 조회 3,379회 작성일 15-01-12 13:34본문
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<script type="text/javascript">
//<![CDATA[
function initMoving(target, position, topLimit, btmLimit) {
if (!target)
return false;
var obj = target;
obj.initTop = position;
obj.topLimit = topLimit;
obj.bottomLimit = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight) - btmLimit - obj.offsetHeight;
obj.style.position = "absolute";
obj.top = obj.initTop;
obj.left = obj.initLeft;
if (typeof(window.pageYOffset) == "number") { //WebKit
obj.getTop = function() {
return window.pageYOffset;
}
} else if (typeof(document.documentElement.scrollTop) == "number") {
obj.getTop = function() {
return Math.max(document.documentElement.scrollTop, document.body.scrollTop);
}
} else {
obj.getTop = function() {
return 0;
}
}
if (self.innerHeight) { //WebKit
obj.getHeight = function() {
return self.innerHeight;
}
} else if(document.documentElement.clientHeight) {
obj.getHeight = function() {
return document.documentElement.clientHeight;
}
} else {
obj.getHeight = function() {
return 500;
}
}
obj.move = setInterval(function() {
if (obj.initTop > 0) {
pos = obj.getTop() + obj.initTop;
} else {
pos = obj.getTop() + obj.getHeight() + obj.initTop;
//pos = obj.getTop() + obj.getHeight() / 2 - 15;
}
if (pos > obj.bottomLimit)
pos = obj.bottomLimit;
if (pos < obj.topLimit)
pos = obj.topLimit;
interval = obj.top - pos;
obj.top = obj.top - interval / 3;
obj.style.top = obj.top + "px";
}, 30)
}
//]]>
</script>
<div style="float:left;width:300px;">가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br>가가가<br></div>
<div id="gotop">내용</div>
<script type="text/javascript">initMoving(document.getElementById("gotop"), 50, 50, 50);</script>
</BODY>
</HTML>
댓글목록
등록된 댓글이 없습니다.