퀵메뉴 스크롤이 중간에 멈춤니다. ㅜㅜ 정보
퀵메뉴 스크롤이 중간에 멈춤니다. ㅜㅜ본문
<!-- 스크롤 퀵메뉴2 시작 -->
<script type="text/javascript">
//<![CDATA[
function initMoving2(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();
}
else
{
pos = obj.getTop() + obj.getHeight();
//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";
}, 5)
}
//]]>
</script>
<!-- 스크롤 퀵메뉴 끝 -->
<!-- 스크롤메뉴를 위한 구성입니다. -->
<div id="gotop2" style='position:relative;top:0px;left:50%;z-index:1'>
<div style='position:absolute;top:0;left:-510px'>
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/assets/images/quick.gif" border="0" usemap="#Map2quickright" />
<map name="Map2quickright" id="Map2quickright">
<area shape="rect" coords="4,42,72,115" href="/guide.php" />
<area shape="rect" coords="4,122,73,193" href="/g4/bbs/board.php?bo_table=faq" />
<area shape="rect" coords="5,199,73,257" href="/g4/plugin/attendance/attendance.php" />
<area shape="rect" coords="3,267,71,325" href="/?doc=mypage&pl=ads" />
</map></td>
</tr>
</table>
</div></div>
<script type="text/javascript">initMoving2(document.getElementById("gotop2"), 20, 182, 20);</script>
<!-- 스크롤메뉴2를 위한 구성입니다. -->]
퀵메뉴를 만들었는데 왜 내려오다가 중간에 멈추는 거죠??
제발 좀 알려주세요 ㅜㅜ
<script type="text/javascript">
//<![CDATA[
function initMoving2(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();
}
else
{
pos = obj.getTop() + obj.getHeight();
//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";
}, 5)
}
//]]>
</script>
<!-- 스크롤 퀵메뉴 끝 -->
<!-- 스크롤메뉴를 위한 구성입니다. -->
<div id="gotop2" style='position:relative;top:0px;left:50%;z-index:1'>
<div style='position:absolute;top:0;left:-510px'>
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/assets/images/quick.gif" border="0" usemap="#Map2quickright" />
<map name="Map2quickright" id="Map2quickright">
<area shape="rect" coords="4,42,72,115" href="/guide.php" />
<area shape="rect" coords="4,122,73,193" href="/g4/bbs/board.php?bo_table=faq" />
<area shape="rect" coords="5,199,73,257" href="/g4/plugin/attendance/attendance.php" />
<area shape="rect" coords="3,267,71,325" href="/?doc=mypage&pl=ads" />
</map></td>
</tr>
</table>
</div></div>
<script type="text/javascript">initMoving2(document.getElementById("gotop2"), 20, 182, 20);</script>
<!-- 스크롤메뉴2를 위한 구성입니다. -->]
퀵메뉴를 만들었는데 왜 내려오다가 중간에 멈추는 거죠??
제발 좀 알려주세요 ㅜㅜ
댓글 전체
아떻게 작동되기를 원하시는가요?
원하는 내용이 있어야 답변을 할 수가 있죠
중간에 멈추는 것은
if (pos > obj.bottomLimit)
pos = obj.bottomLimit;
이렇게 top 위치가 일정 값 이상이 되지않도록 고정시키기 때문입니다
원하는 내용이 있어야 답변을 할 수가 있죠
중간에 멈추는 것은
if (pos > obj.bottomLimit)
pos = obj.bottomLimit;
이렇게 top 위치가 일정 값 이상이 되지않도록 고정시키기 때문입니다