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

· 2013-08-28 (수) 18:22:26 · 1069
<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 질문답변

66,531건

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

+
제목 글쓴이 날짜 조회
13-08-29 조회 1,833
13-08-29 조회 2,953
13-08-28 조회 1,186
13-08-28 조회 870
13-08-28 조회 1,774
13-08-28 조회 821
13-08-28 조회 1,074
13-08-28 조회 1,722
13-08-28 조회 2,620
13-08-28 조회 2,429
13-08-28 조회 1,204
13-08-28 조회 3,294
13-08-28 조회 837
13-08-28 조회 995
13-08-28 조회 1,611
13-08-28 조회 1,070
13-08-28 조회 1,703
13-08-28 조회 834
13-08-28 조회 888
13-08-28 조회 873