오른쪽 퀵메뉴 지마켓처럼 어느지점에 스크롤내리면 상단에 고정되게 하려면 어떻게 하면되나요?? 정보
오른쪽 퀵메뉴 지마켓처럼 어느지점에 스크롤내리면 상단에 고정되게 하려면 어떻게 하면되나요??
본문
$(function(){
var cssTop = parseInt($("#aside .right").css("top"));
$(window).scroll(function(){
var position = $(window).scrollTop();
$("#aside .right").stop().animate({"top":position+cssTop+"px"},1000);
var d, t, s, g, target_height;
origin_top *= 1;
limit_top *= 1;
margin_top *= 1;
d = document.getElementById("aside");
s = document.body.scrollTop + "";
target_height = s.toInteger() + margin_top;
if(target_height < limit_top) {
target_height = origin_top;
}
t = d.style.top.toInteger();
if(t != target_height) {
g = Math.ceil((t - target_height) / 5);
if(g > 500) {
g = 50;
} else if (g < -50) {
g = -50;
}
d.style.top = (t - g) + "px";
}
});
});
>>
위치값을 지정해서 예전에 되던 소스인데요 아무래도 dtd 선언안해주면 인식을 못하는지 잘안되더라구요
어떻게 퀵메뉴 만들어야할까요??
var cssTop = parseInt($("#aside .right").css("top"));
$(window).scroll(function(){
var position = $(window).scrollTop();
$("#aside .right").stop().animate({"top":position+cssTop+"px"},1000);
var d, t, s, g, target_height;
origin_top *= 1;
limit_top *= 1;
margin_top *= 1;
d = document.getElementById("aside");
s = document.body.scrollTop + "";
target_height = s.toInteger() + margin_top;
if(target_height < limit_top) {
target_height = origin_top;
}
t = d.style.top.toInteger();
if(t != target_height) {
g = Math.ceil((t - target_height) / 5);
if(g > 500) {
g = 50;
} else if (g < -50) {
g = -50;
}
d.style.top = (t - g) + "px";
}
});
});
>>
위치값을 지정해서 예전에 되던 소스인데요 아무래도 dtd 선언안해주면 인식을 못하는지 잘안되더라구요
어떻게 퀵메뉴 만들어야할까요??
댓글 전체