效果收集-滚到一定程度再漂浮
适用产品详情 导航漂浮
window.onscroll = function(){ var t = document.documentElement.scrollTop || document.body.scrollTop; var Div = document.getElementById( "fix_goods" ); if( t <= 755 ) { Div.style.position = ""; Div.style.top = ""; } else { //Div.style.display = "none"; Div.style.position = "fixed"; Div.style.top = "-10px"; } }