아래쪽에서 멈추도록이 div를 얻으려고하고 있지만, 바닥에 도달하면 덤핑이 시작됩니다.아래쪽에서 스크롤 div를 멈추게하십시오.
아이디어가 있으십니까? bottom_offset < 181
여전히 CSStop
속성을 계속 변경하는 것처럼 보입니다.
<script>
jQuery(document).ready(function() {
var el = jQuery('#contactBox');
top_offset = jQuery('#contactBox').offset().top - 60;
var box_height = el.height();
jQuery(window).scroll(function() {
var scroll_top = jQuery(window).scrollTop();
var bottom_offset = jQuery(document).height() - scroll_top - box_height;
var new_top_offset = jQuery(document).height() - box_height - 100;
if ((scroll_top > top_offset) && (bottom_offset > 180)) {
el.css('top', scroll_top - top_offset);
}
else if ((scroll_top > top_offset) && (bottom_offset < 181)) {
el.css('top', new_top_offset);
}
else {
el.css('top', '');
}
});
});
</script>
만약 우리가 무슨 일이 일어나는지 볼 수 있도록 몇 가지 HTML과 CSS를 게시 할 수 있다면. – Matt