맨위로
믹시
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title></title>
<script type="text/javascript">
// scrolling layer
function initMoving(target, position, topLimit, btmLimit) {
if (!target)
return false;

var obj = target;
obj.initTop = position;
obj.topLimit = topLimit;
obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;

obj.style.position = "absolute";
obj.top = obj.initTop;
obj.left = obj.initLeft;

if (typeof(window.pageYOffset) == "number") {
obj.getTop = function() {
return window.pageYOffset;
}
} else if (typeof(document.documentElement.scrollTop) == "number") {
obj.getTop = function() {
return document.documentElement.scrollTop;
}
} else {
obj.getTop = function() {
return 0;
}
}

if (self.innerHeight) {
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)
}
//scrolling layer end

</script>
<style type="text/css">
body{ font-size:12px;}
.box{background:#66CCFF; width:500px; height:2000px; margin:auto; position:relative; padding:30px;}
</style>
</head>
<body>
<div class="box"><h3>Contents</h3>
<div style="position:absolute; top:300px; right:-30px" id="topBtn"><a href="#">top↑</a></div>
<script type="text/javascript">initMoving(document.getElementById("topBtn"), 450, 200, 200)</script>
</div>
</body>
</html>











List of Articles
번호 제목 글쓴이 날짜 조회 수 최근 수정일
공지 Windows 웹개발관련 팁,소스등을 모아놓은곳입니다. file id: 김선생 2006-03-09 86384 2011-02-01 23:57

Actionscript 가속도운동,반동운동 스크립트 file

speed1 = 4; mc1.onEnterFrame = function() { this._x += (400-this._x)/speed1; } speed2 = 0; mc2.onEnterFrame = function() { speed2 = ((400-this._x)*0.3)+(speed2*0.6); this._x += speed2; }; 자주쓰는데 외우지는...

  • id: 김기현
  • 2009-10-09
  • 조회 수 5552
  • 2009-10-09 18:39

Javascript 트리구조메뉴 2가지!! file

DynamicTree.zip 출처 : http://cafe.naver.com/webdeveloper dtree.zip 출처 : www.destroydrop.com/javascript/tree/

  • id: 김기현
  • 2009-09-18
  • 조회 수 7353
  • 2009-09-18 18:15

Javascript 따라다니는 스크롤 탑 버튼 스크립트 - 2 웹표준호환 file

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="tex...

  • id: 김선생
  • 2009-09-08
  • 조회 수 4848
  • 2010-05-17 12:38

Actionscript loading 액션 로딩 file

onClipEvent(enterFrame) { var now = _root.getBytesLoaded(); var total = _root.getBytesTotal(); if(now != total){ this.bar._xscale = (now/total)*100; this.display = Math.round(now/1000)+"KB/ " + Math.round(total...

  • id: 김기현
  • 2009-09-03
  • 조회 수 5416
  • 2009-09-18 22:30

Javascript 레이어공지창 한번만 띄우기 file

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="t...

  • id: 김기현
  • 2009-08-26
  • 조회 수 4300
  • 2009-09-25 17:43

Actionscript 무비클립 속성 여러개 적용하기

with (mc1) { _x = 0; _y = 200; _width = 240; }

  • id: 김기현
  • 2009-08-25
  • 조회 수 4182
  • 2009-09-25 17:34

Actionscript 플래쉬 롤링배너 xml연동소스 file

최고10개 까지 활용 가능한 플래쉬 소스입니다. 출처 http://www.imgwizard.com [이미지위자드] <?xml version="1.0" encoding="euc-kr" ?> <xml> <banner img="img/event01.jpg" link="aaa.php" target="_blank" /> <banner img="img/even...

  • id: 김기현
  • 2009-08-24
  • 조회 수 10379
  • 2009-11-26 17:34

Javascript 톰켓 6.0 ROOT 변경하기 file

음... 일단 두 가지의 방법이 있습니다. 하나는 기존의 루트를 수정하지 않고 다른 가상디렉토리를 만드는 방법입니다. 다른 하나는 질문하신것과 같은 루트자체를 수정하는 방법입니다. 위 두가지 방식 모두 톰캣설치디렉토리 하위...

  • id: 김기현
  • 2009-07-30
  • 조회 수 8344
  • 2009-07-30 11:38

HTML/CSS 즐겨찾기 아이콘 fav.ico 파일 넣기 file

<link rel="icon" href="/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> <link rel="icon" href="/animated_favicon.gif" type="image/gif" />

  • id: 김기현
  • 2009-07-29
  • 조회 수 4839
  • 2009-09-23 14:45

Javascript 풀다운 서브메뉴 롤오버,클릭 file

rollOverSub.zip 웹표준,ie5.7.8 사파리

  • id: 김기현
  • 2009-07-21
  • 조회 수 6940
  • 2009-07-21 10:43