퀵메뉴가 밑으로 뚫고 들어갑니다

· 12년 전 · 1003
<script type="text/javascript">
function Floating(FloatingObj,MarginY,Percentage,setTime) {
this.FloatingObj = FloatingObj;
this.MarginY = (MarginY) ? MarginY : 0;
this.Percentage = (Percentage) ? Percentage : 20;
this.setTime = (setTime) ? setTime : 10;
this.FloatingObj.style.position = "absolute";
this.Body = null;
this.setTimeOut = null;
this.Run();
}

Floating.prototype.Run = function () {
if ((document.documentElement.scrollLeft + document.documentElement.scrollTop) > (document.body.scrollLeft + document.body.scrollTop)) {
this.Body = document.documentElement;
} else {
this.Body = document.body;
}

var This = this;
var FloatingObjLeft = (this.FloatingObj.style.left) ? parseInt(this.FloatingObj.style.left,10) : this.FloatingObj.offsetLeft;
var FloatingObjTop = (this.FloatingObj.style.top) ? parseInt(this.FloatingObj.style.top,10) : this.FloatingObj.offsetTop;
var DocTop = this.Body.scrollTop + this.MarginY;

var MoveY = Math.abs(FloatingObjTop - DocTop);
MoveY = Math.ceil(MoveY / this.Percentage);


if (FloatingObjTop < DocTop) {
this.FloatingObj.style.top = FloatingObjTop + MoveY + "px";
} else {
this.FloatingObj.style.top = FloatingObjTop - MoveY + "px";
}

window.clearTimeout(this.setTimeOut);
this.setTimeOut = window.setTimeout(function () { This.Run(); },this.setTime);
}
</script>

<script type="text/javascript">
//new Floating(적용할개체 , Y축여백 , 미끄러지는속도:작을수록빠름..기본20 , 빠르기:작을수록부드러움..기본10);
new Floating(document.getElementById("quick"),10,10,5);
</script>

검색해서 저 소스를 사용하고 있는데

큰 해상도에서는 문제가 안되는데 작은 해상도일 경우엔 배너가 밑으로 뚫고 들어가서 무한 스크롤이 되네요.

어떻게 해결해야할지 모르겠습니다..
|
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

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

+
제목 글쓴이 날짜 조회
12년 전 조회 1,002
12년 전 조회 1,664
12년 전 조회 2,558
12년 전 조회 2,354
12년 전 조회 1,143
12년 전 조회 3,227
12년 전 조회 773
12년 전 조회 919
12년 전 조회 1,544
12년 전 조회 1,004
12년 전 조회 1,630
12년 전 조회 766
12년 전 조회 810
12년 전 조회 785
12년 전 조회 1,378
12년 전 조회 1,565
12년 전 조회 1,040
12년 전 조회 1,581
12년 전 조회 1,559
12년 전 조회 2,048