웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
레이어를 원하는 곳에 고정하기입니다.
2002.11.14 14:00
간단한 레이어 고정하기 입니다.
<script language="JavaScript">
<!--
self.onError=null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0; lastScrollY = 0;
action = window.setInterval("heartBeat()",1);
function heartBeat() {
// combowidth=layer_right_bottom.offsetWidth
// comboheight=layer_right_bottom.offsetHeight
diffY = document.body.scrollTop;
diffX = 0;
if (diffY != lastScrollY) {
percent = .2 * (diffY - lastScrollY);
if (percent > 0) {
percent = Math.ceil(percent);
} else {
percent = Math.floor(percent);
}
document.all.layer_right.style.pixelTop += percent;
// document.all.layer_right_bottom.style.pixelTop = document.body.scrollTop+document.body.clientHeight-comboheight+percent-50;
lastScrollY = lastScrollY + percent;
}
if (diffX != lastScrollX) {
percent = .2 * (diffX - lastScrollX);
if (percent > 0) {
percent = Math.ceil(percent);
} else {
percent = Math.floor(percent);
}
document.all.layer_right.style.pixelLeft += percent;
// document.all.layer_right_bottom.style.pixelLeft += percent;
lastScrollY = lastScrollY + percent;
}
}
//-->
</script>
<div id="layer_right" style="width:165px; height:347px; position:absolute; left:781px; top:100px; z-index:10; visibility:visible;">
<table border='0' cellpadding='0' cellspacing='1' width='165'>
<tr>
<td align='right' height='50'>
<p><a href='클릭시 이동할 주소' onfocus='this.blur()'><img src="원하는 그림" border='1' alt='날으는 돼지임당'></a></p>
</td>
</tr>
</table>
</div>
이동주소나 우너하는 그림이나 기타 내용을 유저분들이 넣으면 돼겠죠.
샘플은 아래주소를 클릭하세요.
http://diyworld.biz/test2.html
여기 자료실에 있는지 몰겠지만 아주 유용할것 같아 올립니다.
괜찮으면 추천한방,.^^
<script language="JavaScript">
<!--
self.onError=null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0; lastScrollY = 0;
action = window.setInterval("heartBeat()",1);
function heartBeat() {
// combowidth=layer_right_bottom.offsetWidth
// comboheight=layer_right_bottom.offsetHeight
diffY = document.body.scrollTop;
diffX = 0;
if (diffY != lastScrollY) {
percent = .2 * (diffY - lastScrollY);
if (percent > 0) {
percent = Math.ceil(percent);
} else {
percent = Math.floor(percent);
}
document.all.layer_right.style.pixelTop += percent;
// document.all.layer_right_bottom.style.pixelTop = document.body.scrollTop+document.body.clientHeight-comboheight+percent-50;
lastScrollY = lastScrollY + percent;
}
if (diffX != lastScrollX) {
percent = .2 * (diffX - lastScrollX);
if (percent > 0) {
percent = Math.ceil(percent);
} else {
percent = Math.floor(percent);
}
document.all.layer_right.style.pixelLeft += percent;
// document.all.layer_right_bottom.style.pixelLeft += percent;
lastScrollY = lastScrollY + percent;
}
}
//-->
</script>
<div id="layer_right" style="width:165px; height:347px; position:absolute; left:781px; top:100px; z-index:10; visibility:visible;">
<table border='0' cellpadding='0' cellspacing='1' width='165'>
<tr>
<td align='right' height='50'>
<p><a href='클릭시 이동할 주소' onfocus='this.blur()'><img src="원하는 그림" border='1' alt='날으는 돼지임당'></a></p>
</td>
</tr>
</table>
</div>
이동주소나 우너하는 그림이나 기타 내용을 유저분들이 넣으면 돼겠죠.
샘플은 아래주소를 클릭하세요.
http://diyworld.biz/test2.html
여기 자료실에 있는지 몰겠지만 아주 유용할것 같아 올립니다.
괜찮으면 추천한방,.^^
댓글 7
제목 | 글쓴이 | 날짜 |
---|---|---|
네트워크 보안 - 스팸메일 추적 방법 [10] | 정후니 | 2001.09.29 |
[팁] mysql root password 분실했을 때 [5] | 최상훈 | 2001.09.27 |
윈도우에 설치된 MySQL의 root 패스워드 분실시 대처방법 [7] | Mintzz | 2001.04.29 |
리눅스 스왑 파티션 만들기 | skywalkers | 2001.01.03 |
MySQL DB(디비)와 Table(테이블) Delete(삭제/초기화)하는 방법 [16] | 차카게살자 | 2002.01.01 |
회원가입할때 중복막기 [4] | 김도훈449 | 2009.01.25 |
?=down [4] | L-Goon | 2009.01.19 |
간단한 ajax 채팅소스입니다. [12] | 제로저아 | 2008.10.23 |
기초설명_변수를 알기전에.. [2] | ifnelse | 2008.07.28 |
기초설명_자바스크립트와 PHP와의 가장 큰 차이점 [4] | ifnelse | 2008.07.28 |
기초설명_알고리즘(algorithm) [2] | ifnelse | 2008.07.28 |
PHP_9_My-sql함수를 이용한 프로그램_1 | 아무흐 | 2008.07.15 |
PHP 가변변수와 이항연산자에 대해 | 특급잠수부 | 2008.05.03 |
PHP에 입문하시는 분들을 위해 적어봅니다. [5] | 특급잠수부 | 2008.04.26 |
PHP_7_간단한 폼메일 만들기 [1] | 아무흐 | 2008.04.03 |
GD를 이용해 즉석에서 룰오버 링크버튼 만들기 | 김현석181 | 2008.03.29 |
PHP_6_간단한 폼 구구단을 만들어 보자 [2] | 아무흐 | 2008.03.26 |
PHP_5_IF 문과 기본 연산자 [1] | 아무흐 | 2008.03.26 |
PHP_4_변수 | OGIT | 2008.03.25 |
해시로부터 주민등록번호 복호화 [2] | fallstoofast | 2008.03.12 |