$(function(){ $(window).scroll(function(){ var scroll_top=$(window).scrollTop(); console.log(scroll_top) if(scroll_top>=200){ $("#lianxi").fadeIn(); }else{ $("#lianxi").fadeOut(); } }) })