이런건 어떻게 하는건가요??

http://news.khan.co.kr/kh_news/cp_art_view.html?artid=20100503113235A&code=910402



http://www.hani.co.kr/arti/opinion/because/418809.html


두 신문사 왼쪽 보시면 스크롤바에 따라서 내려오는게 있는데 이런건 어떻게 하느건가요??

sir에서 예전에 소스를 본것같은데.. 혹시 아시는분...
|

댓글 2개

스크롤을 움직이면 항상 그 위치에서 메뉴가 나타나는 기능입니다.
아래의 내용을 차례대로 넣어보세요.
스크립트는 가장 아래에 위치시키세요.

■ <Head> 와 </Head> 사이에 스크립트를 넣으세요.

<SCRIPT-x LANGUAGE="JavaScript-x">
<!--
function fix(){
var a=document.body.scrollTop+190
bar.style.top = a
}
-->
</SCRIPT-x>


■ <Body> 내용안에 <onScroll="fix()"> 를 넣어주세요.

<body bgcolor="#FFFFFF" text="#000000" onScroll="fix()">


■ <Body> 와 </Body> 사이에 넣으세요.

<span id="bar" style="position:absolute; visibility:visible; left:20px; top:190px; z-index:1; width: 90px; height: 300px">메뉴로 사용할 내용을 넣어주세요</span>
</script>
<div align="center">
<script language="JavaScript" type="text/JavaScript">
function LayerResized0()
{
if(document.body.offsetWidth > 1024) {
//revalue = (document.body.clientWidth/2 + ((screen.width-1024)*2));
revalue =(document.body.offsetWidth - 1024)/2 - 0;
// alert(screen.width);
}else{
revalue = -90;
}
return revalue;
}

function LayerResized()
{
if(document.body.offsetWidth > 963) {
//revalue = (document.body.clientWidth/2 + ((screen.width-1024)*2));
// revalue = (document.body.offsetWidth/2 + ((screen.width-1204)*2));
revalue = (document.body.offsetWidth/2) + 475;
}else{
revalue = 963;
}
return revalue;
}

</script>
<script language="JavaScript">
var StartPos=153; // 처음 위쪽 여백
var MovePos=25; // 스크롤 될때 위쪽 여백
var MaxHeight

function InitMove()
{
rtmenu.style.top = document.body.scrollTop + StartPos;
MaxHeight = document.body.scrollHeight;
MoveMenu();
}

function MoveMenu()
{
var yBannerPos, yScrollTopPos
var yLimitPos
var interval
var yNewPos
var SetValue

yScrollTopPos = parseInt(document.body.scrollTop,10);
yBannerPos = parseInt(rtmenu.style.top, 10);

if( document.body.scrollTop < StartPos )
yLimitPos = StartPos ;
else
yLimitPos = document.body.scrollTop + MovePos ;

if (yBannerPos != yLimitPos)
{
yNewPos = Math.ceil(Math.abs(yLimitPos - yBannerPos)/20); //반올림
if(yLimitPos < yBannerPos)
{
yNewPos = -yNewPos;
}

SetValue = parseInt(rtmenu.style.top, 10) + yNewPos;

if (SetValue > MaxHeight )
rtmenu.style.top = MaxHeight;
else
rtmenu.style.top = SetValue;
}
setTimeout ("MoveMenu()",10)
}

function InitMove0()
{
rtmenu0.style.top = document.body.scrollTop + StartPos;
MaxHeight = document.body.scrollHeight;
MoveMenu0();
}

function MoveMenu0()
{
var yBannerPos, yScrollTopPos
var yLimitPos
var interval
var yNewPos
var SetValue

yScrollTopPos = parseInt(document.body.scrollTop,10);
yBannerPos = parseInt(rtmenu0.style.top, 10);

if( document.body.scrollTop < StartPos )
yLimitPos = StartPos ;
else
yLimitPos = document.body.scrollTop + MovePos ;

if (yBannerPos != yLimitPos)
{
yNewPos = Math.ceil(Math.abs(yLimitPos - yBannerPos)/20); //반올림
if(yLimitPos < yBannerPos)
{
yNewPos = -yNewPos;
}

SetValue = parseInt(rtmenu0.style.top, 10) + yNewPos;

if (SetValue > MaxHeight )
rtmenu0.style.top = MaxHeight;
else
rtmenu0.style.top = SetValue;
}
setTimeout ("MoveMenu0()",10)
}

</script>


<!-- 베이징 올림픽 이벤트 -->
<!-- /popup -->
<!-- google-analytics -->
<div id="rtmenu0" style="top:152px; position:absolute; z-index:5; width:150px; height:344px; left: 0;">
<div id="object0">
<table width="150" height="339">
<tr>
<td width="150" valign="middle">&nbsp;</td>
</tr>
</table>
</div>
</div>
<div id="rtmenu" style="top:151px; left:expression(LayerResized()); position:absolute; z-index:5; width:150px;

height:164px;">
<div id="object1">
<table height="162">
<tr>
<td width="88" valign="top" bgcolor="#000000">&nbsp;</td>
</tr>
</table>
</div>
</div>
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
15년 전 조회 1,528
15년 전 조회 1,785
15년 전 조회 1,375
15년 전 조회 2,979
15년 전 조회 1,573
15년 전 조회 2,847
15년 전 조회 1,414
15년 전 조회 2,976
15년 전 조회 4,210
15년 전 조회 1,555
15년 전 조회 1,530
15년 전 조회 1,608
15년 전 조회 1,519
15년 전 조회 1,533
15년 전 조회 2,974
15년 전 조회 2,052
15년 전 조회 1,534
15년 전 조회 1,418
15년 전 조회 1,559
15년 전 조회 1,603
🐛 버그신고