html元素在jQuery滚动到特定位置出现或隐藏
Document*{margin:0; padding:0;}
body{ max-width: 640px; margin:0 auto; }
.box{ display: block; height: 50px; line-height: 50px;text-align: center; border:1px solid #ccc; border-radius: 20px; background-color: #ddd; margin-top: 30px; position: fixed; bottom: 0; left: 0; width: 100%; z-index: 9 }
当滚到到这个div,隐藏下面的按钮
$(function(){
var demoHeight = $("#demo").offset().top;
window.οnscrοll=function(){
var this_scrollTop = $(this).scrollTop();
if(this_scrollTop>demoHeight ){
$("#btn").hide();
}else{
$("#btn").show();
}
};
});