标签:pre position bsp http pos nbsp java 滚动 png
首先看效果图:
最开始鼠标没有滚动的时候:
当鼠标滚动下拉到一定高度的时候:
侧边的悬浮框会一直悬浮在最左边,实现导航的悬浮。
通过js代码实现:
js代码:
var n_t1 = $(‘body‘).height() * 0.12; if(scrTop < n_t1){ $(‘.content2_left‘).css("position","absolute") $(‘.content2_left‘).css("left","0px") $(‘.content2_left‘).css("top","0px") }else{ $(‘.content2_left‘).show() // $(‘.content2_left‘).css("background-color","red") $(‘.content2_left‘).css("position","fixed") $(‘.content2_left‘).css("left","10%") $(‘.content2_left‘).css("top","5%") }
标签:pre position bsp http pos nbsp java 滚动 png
原文地址:https://www.cnblogs.com/Ky-Thompson23/p/11895653.html