Home  >  Article  >  Web Front-end  >  根据滚动条滚动距离设置不固定div 在线等答复!谢谢。_html/css_WEB-ITnose

根据滚动条滚动距离设置不固定div 在线等答复!谢谢。_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 09:22:54929browse

如图所示。div底部已经盖住下面的div的,目的是想要div底部靠近下面div的顶部时就不再固定会跟着页面滚动!


回复讨论(解决方案)

你底部设置了绝对定位吗 .  高度设置auto试试  。

获取你的对象计算得到630这个数值啊。。

var o=$('定位元素的选择器'), otop=o.offset().top+o.height();

获取你的对象计算得到630这个数值啊。。

var o=$('定位元素的选择器'), otop=o.offset().top+o.height();


谢谢
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn