그누 스킨중에 홈페이지 가운데 정렬에도 퀵메뉴 잡아주는 소스가 있길레 사용 하려하는데요..
이소스를 사용해보니 약간의 문제(?)가 있어서요...
위치도 거의 딱 잡아주는데 문제는 처음 시작위치와 스크롤될때의 퀵메뉴위치를 잡아주는게 없어서인지 낮은 해상도에서는 홈페이지 아래로 무한 스크롤이 가능하더라고요....
무한 스크롤 안되게 하는 법좀 가르쳐주세요~~
<SCRIPT language=javascript>
//사용함수
function ResetRemocon(){
var DivMovingLayerYFrom, DivMovingLayerYTo, OffsetY, ResetTime;
ResetTime = 50;
if (DivMovingLayerRule == 'center'){
//해상도 기준, 가운데 에서 x만큼 떨어진 곳에 위치
if (navigator.userAgent.toLowerCase().indexOf("gecko") > -1) {
if (document.body.clientWidth < ContentsWidth + 10) {
DivMovingLayer.style.left = parseInt (ContentsWidth / 2, 10) + DivMovingLayerX + 10 + "px";
}
else {
DivMovingLayer.style.left = (DivMovingLayerX + (document.body.clientWidth / 2)) + "px";
}
}
else{
if (document.body.clientWidth < ContentsWidth) {
DivMovingLayer.style.left = parseInt (ContentsWidth / 2, 10) + DivMovingLayerX + "px";
}
else {
DivMovingLayer.style.left = (DivMovingLayerX + (document.body.clientWidth / 2)) + "px";
}
}
}
else if (DivMovingLayerRule == 'left'){
//해상도와 무관, 왼쪽 에서 x만큼 떨어진 곳에 위치
DivMovingLayer.style.left = (DivMovingLayerX) + "px";
}
DivMovingLayerYFrom = parseInt (DivMovingLayer.style.top, 10);
DivMovingLayerYTo = DivMovingLayerY + document.body.scrollTop + 1;
if ( DivMovingLayerYFrom != DivMovingLayerYTo ) {
OffsetY = Math.ceil( Math.abs( DivMovingLayerYTo - DivMovingLayerYFrom ) / 20 );
if ( DivMovingLayerYTo < DivMovingLayerYFrom )
OffsetY = -OffsetY;
DivMovingLayer.style.top = (DivMovingLayerYFrom + OffsetY) + "px";
ResetTime = 10;
}
setTimeout ("ResetRemocon()", ResetTime);
}
function SetRemocon() {
DivMovingLayer.style.display = "block";
DivMovingLayer.style.top = (DivMovingLayerY + document.body.scrollTop + 1) + "px";
ResetRemocon();
return true;
}
function NoneRemocon() {
DivMovingLayer.style.display = "none";
selectBoxVisible();
}
//레이어 디자인부분
document.write("<div id=DivMovingLayer style='position:absolute;left:0px;top:360px; z-index:8;display:none;'>");
document.write("<tr><td align='center'><img src='/2008/images/sub/quick.gif' border='0'></td></tr>");
document.write("</table>");
document.write("</div>");
if (typeof document.body == "undefined")
document.body = document.getElementsByTagName("BODY")[0];
var DivMovingLayer = document.getElementById("DivMovingLayer");
//환경설정
var ContentsWidth = 955;//움직이는 레이어를 제외한 콘텐츠 너비, 가운데 정렬에만 해당, 전체 테이블중 제일큰 테이블 너비
var DivMovingLayerX =387;//레이어가 위치할 레프트 값
var DivMovingLayerY = 360;//레어가 위치할 탑 값
var DivMovingLayerRule = 'center';//center -->가운데 정렬을 기준으로 x만큼, left --> 레프트 정렬을 기준으로 x만큼
//레이어 보이기
//SetRemocon();
window.onload=SetRemocon;
</SCRIPT>
이소스를 사용해보니 약간의 문제(?)가 있어서요...
위치도 거의 딱 잡아주는데 문제는 처음 시작위치와 스크롤될때의 퀵메뉴위치를 잡아주는게 없어서인지 낮은 해상도에서는 홈페이지 아래로 무한 스크롤이 가능하더라고요....
무한 스크롤 안되게 하는 법좀 가르쳐주세요~~
<SCRIPT language=javascript>
//사용함수
function ResetRemocon(){
var DivMovingLayerYFrom, DivMovingLayerYTo, OffsetY, ResetTime;
ResetTime = 50;
if (DivMovingLayerRule == 'center'){
//해상도 기준, 가운데 에서 x만큼 떨어진 곳에 위치
if (navigator.userAgent.toLowerCase().indexOf("gecko") > -1) {
if (document.body.clientWidth < ContentsWidth + 10) {
DivMovingLayer.style.left = parseInt (ContentsWidth / 2, 10) + DivMovingLayerX + 10 + "px";
}
else {
DivMovingLayer.style.left = (DivMovingLayerX + (document.body.clientWidth / 2)) + "px";
}
}
else{
if (document.body.clientWidth < ContentsWidth) {
DivMovingLayer.style.left = parseInt (ContentsWidth / 2, 10) + DivMovingLayerX + "px";
}
else {
DivMovingLayer.style.left = (DivMovingLayerX + (document.body.clientWidth / 2)) + "px";
}
}
}
else if (DivMovingLayerRule == 'left'){
//해상도와 무관, 왼쪽 에서 x만큼 떨어진 곳에 위치
DivMovingLayer.style.left = (DivMovingLayerX) + "px";
}
DivMovingLayerYFrom = parseInt (DivMovingLayer.style.top, 10);
DivMovingLayerYTo = DivMovingLayerY + document.body.scrollTop + 1;
if ( DivMovingLayerYFrom != DivMovingLayerYTo ) {
OffsetY = Math.ceil( Math.abs( DivMovingLayerYTo - DivMovingLayerYFrom ) / 20 );
if ( DivMovingLayerYTo < DivMovingLayerYFrom )
OffsetY = -OffsetY;
DivMovingLayer.style.top = (DivMovingLayerYFrom + OffsetY) + "px";
ResetTime = 10;
}
setTimeout ("ResetRemocon()", ResetTime);
}
function SetRemocon() {
DivMovingLayer.style.display = "block";
DivMovingLayer.style.top = (DivMovingLayerY + document.body.scrollTop + 1) + "px";
ResetRemocon();
return true;
}
function NoneRemocon() {
DivMovingLayer.style.display = "none";
selectBoxVisible();
}
//레이어 디자인부분
document.write("<div id=DivMovingLayer style='position:absolute;left:0px;top:360px; z-index:8;display:none;'>");
document.write("<tr><td align='center'><img src='/2008/images/sub/quick.gif' border='0'></td></tr>");
document.write("</table>");
document.write("</div>");
if (typeof document.body == "undefined")
document.body = document.getElementsByTagName("BODY")[0];
var DivMovingLayer = document.getElementById("DivMovingLayer");
//환경설정
var ContentsWidth = 955;//움직이는 레이어를 제외한 콘텐츠 너비, 가운데 정렬에만 해당, 전체 테이블중 제일큰 테이블 너비
var DivMovingLayerX =387;//레이어가 위치할 레프트 값
var DivMovingLayerY = 360;//레어가 위치할 탑 값
var DivMovingLayerRule = 'center';//center -->가운데 정렬을 기준으로 x만큼, left --> 레프트 정렬을 기준으로 x만큼
//레이어 보이기
//SetRemocon();
window.onload=SetRemocon;
</SCRIPT>
게시글 목록
| 번호 | 제목 |
|---|---|
| 209 |
개발자
질문은 아니지만..
1
|
| 202 | |
| 193 | |
| 192 | |
| 185 | |
| 177 | |
| 174 | |
| 171 | |
| 167 | |
| 162 |
개발자
latest() sql
4
|
| 160 | |
| 157 | |
| 150 |
디자이너
포토샵 색상문제 좀 봐주세요.
6
|
| 147 | |
| 145 |
개발자
헉........
1
|
| 142 |
개발자
플래쉬파일로
3
|
| 138 | |
| 133 | |
| 130 | |
| 127 |
개발자
php질문좀 하겠습니다.
2
|
| 117 | |
| 115 | |
| 111 |
디자이너
샘플같이 글씨 쓰는 방법...?
3
|
| 105 |
디자이너
글꼴 이름 좀 부탁드립니다.
5
|
| 102 | |
| 98 |
개발자
php 질문(초초보)
3
|
| 90 |
개발자
어떻게 하면...
7
|
| 77 | |
| 73 |
디자이너
그라이언트 주는 방법?
3
|
| 70 |
디자이너
투명도 주는 방법?
2
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기