퀵메뉴가 밑으로 뚫고 들어갑니다 정보
퀵메뉴가 밑으로 뚫고 들어갑니다본문
<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>
검색해서 저 소스를 사용하고 있는데
큰 해상도에서는 문제가 안되는데 작은 해상도일 경우엔 배너가 밑으로 뚫고 들어가서 무한 스크롤이 되네요.
어떻게 해결해야할지 모르겠습니다..
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>
검색해서 저 소스를 사용하고 있는데
큰 해상도에서는 문제가 안되는데 작은 해상도일 경우엔 배너가 밑으로 뚫고 들어가서 무한 스크롤이 되네요.
어떻게 해결해야할지 모르겠습니다..
댓글 전체