묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
움직이는 레이어가 게시판에서는 먹질 않습니다.
2007.05.23 11:49
직접 보시는 편이 이해하기 빠르리라 생각해서 링크 올립니다.
예제 : http://jikili.com/test/test7.htm
일반문서에서는 먹는데... ㅡ,.ㅡ
부탁드립니다...
위 예제에서 사용되어진 소스입니다.
Header
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<!-- 퀵메뉴 시작-->
<script language="javascript">
<!--
var StartPos = 100; // 슬라이드 메뉴 시작위치
var Y = 450; // 페이지 헤더부분의 여백
var slideY = 30; // 슬라이드시 브라우저 상단과 띄워지는 거리
var StopPoint = document.body.scrollHeight - Y - 0; //슬라이드가 멈추는 위치
var slideWatch;
var slideSpeed = 500; // 슬라이드 속도
var slideSpeed2 = 0; //
function ReadCookie(name)
{
var label = name + "=";
var labelLen = label.length;
var cLen = document.cookie.length;
var i = 0;
while (i < cLen) {
var j = i + labelLen;
if (document.cookie.substring(i, j) == label) {
var cEnd = document.cookie.indexOf(";", j);
if (cEnd == -1) cEnd = document.cookie.length;
return unescape(document.cookie.substring(j, cEnd));
}
i++;
}
return "";
}
function SaveCookie(name, value, expire)
{
var eDate = new Date();
eDate.setDate(eDate.getDate() + expire);
document.cookie = name + "=" + value + "; expires=" + eDate.toGMTString()+ "; path=/";
}
function Refreshslide1()
{
var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;
stmnStartPoint = parseInt(slide1.style.top, 10);
stmnEndPoint = document.body.scrollTop + slideY;
if (stmnEndPoint < Y) stmnEndPoint = Y;
stmnRefreshTimer = slideSpeed;
if ( stmnStartPoint != stmnEndPoint) {
stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
slide1.style.top = parseInt(slide1.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
if (parseInt(slide1.style.top, 10)>StopPoint) slide1.style.top = StopPoint;
stmnRefreshTimer = slideSpeed2;
}
slideWatch = setTimeout ("Refreshslide1();", stmnRefreshTimer);
}
function ToggleAnimate()
{
if (!ANIMATE.checked) {
Refreshslide1();
SaveCookie("ANIMATE", "true", 300);
}
else {
clearTimeout(slideWatch);
slide1.style.top = Y;
SaveCookie("ANIMATE", "false", 300);
}
}
function Initslide1()
{
if (ReadCookie("ANIMATE") == "false") {
ANIMATE.checked = true;
slide1.style.top = document.body.scrollTop + Y;
}
else {
ANIMATE.checked = false;
slide1.style.top = document.body.scrollTop + StartPos;
Refreshslide1();
}
}
-->
</script>
</HEAD>
<BODY>
<table border="1" cellspacing="0" cellpadding="0" width=900>
<tr>
<td colspan=2 align=center>
<a href=../bbs/zboard.php?id=test2>제로보드게시판</a> / <a href=../test/test7.htm>일반 텍스트</a>
<tr>
<td width=800>
Footer
</td>
<td width=100>
<div id="slide1" style="position:absolute; top:0px; width:55; height:50; z-index:0;visibility:visible;">
<!-- 메뉴 테이블 시작 -->
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
부메뉴
</td>
</tr>
<tr>
<td height="20" bgcolor="#FFFFFF" align=center><input id="ANIMATE" type="checkbox" onclick="ToggleAnimate();"> 슬라이드 멈추기</td>
</tr>
</table>
<!--메뉴 테이블 끝-->
</div>
<script language="javascript">
<!--
Initslide1();
//-->
</script>
<!-- 퀵메뉴 끝 -->
</td>
</tr>
</table>
예제 : http://jikili.com/test/test7.htm
일반문서에서는 먹는데... ㅡ,.ㅡ
부탁드립니다...
위 예제에서 사용되어진 소스입니다.
Header
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<!-- 퀵메뉴 시작-->
<script language="javascript">
<!--
var StartPos = 100; // 슬라이드 메뉴 시작위치
var Y = 450; // 페이지 헤더부분의 여백
var slideY = 30; // 슬라이드시 브라우저 상단과 띄워지는 거리
var StopPoint = document.body.scrollHeight - Y - 0; //슬라이드가 멈추는 위치
var slideWatch;
var slideSpeed = 500; // 슬라이드 속도
var slideSpeed2 = 0; //
function ReadCookie(name)
{
var label = name + "=";
var labelLen = label.length;
var cLen = document.cookie.length;
var i = 0;
while (i < cLen) {
var j = i + labelLen;
if (document.cookie.substring(i, j) == label) {
var cEnd = document.cookie.indexOf(";", j);
if (cEnd == -1) cEnd = document.cookie.length;
return unescape(document.cookie.substring(j, cEnd));
}
i++;
}
return "";
}
function SaveCookie(name, value, expire)
{
var eDate = new Date();
eDate.setDate(eDate.getDate() + expire);
document.cookie = name + "=" + value + "; expires=" + eDate.toGMTString()+ "; path=/";
}
function Refreshslide1()
{
var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;
stmnStartPoint = parseInt(slide1.style.top, 10);
stmnEndPoint = document.body.scrollTop + slideY;
if (stmnEndPoint < Y) stmnEndPoint = Y;
stmnRefreshTimer = slideSpeed;
if ( stmnStartPoint != stmnEndPoint) {
stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
slide1.style.top = parseInt(slide1.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
if (parseInt(slide1.style.top, 10)>StopPoint) slide1.style.top = StopPoint;
stmnRefreshTimer = slideSpeed2;
}
slideWatch = setTimeout ("Refreshslide1();", stmnRefreshTimer);
}
function ToggleAnimate()
{
if (!ANIMATE.checked) {
Refreshslide1();
SaveCookie("ANIMATE", "true", 300);
}
else {
clearTimeout(slideWatch);
slide1.style.top = Y;
SaveCookie("ANIMATE", "false", 300);
}
}
function Initslide1()
{
if (ReadCookie("ANIMATE") == "false") {
ANIMATE.checked = true;
slide1.style.top = document.body.scrollTop + Y;
}
else {
ANIMATE.checked = false;
slide1.style.top = document.body.scrollTop + StartPos;
Refreshslide1();
}
}
-->
</script>
</HEAD>
<BODY>
<table border="1" cellspacing="0" cellpadding="0" width=900>
<tr>
<td colspan=2 align=center>
<a href=../bbs/zboard.php?id=test2>제로보드게시판</a> / <a href=../test/test7.htm>일반 텍스트</a>
<tr>
<td width=800>
Footer
</td>
<td width=100>
<div id="slide1" style="position:absolute; top:0px; width:55; height:50; z-index:0;visibility:visible;">
<!-- 메뉴 테이블 시작 -->
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
부메뉴
</td>
</tr>
<tr>
<td height="20" bgcolor="#FFFFFF" align=center><input id="ANIMATE" type="checkbox" onclick="ToggleAnimate();"> 슬라이드 멈추기</td>
</tr>
</table>
<!--메뉴 테이블 끝-->
</div>
<script language="javascript">
<!--
Initslide1();
//-->
</script>
<!-- 퀵메뉴 끝 -->
</td>
</tr>
</table>
여기가 문제였습니다. ^^;
var StopPoint = document.body.scrollHeight - Y + 1500; //슬라이드가 멈추는 위치
이렇게 하니 먹네요.. ㅋㅋ