<强> Fiddle
如果您在 fiddle 中从 .wrapper
中删除 overflow
属性,航点将正常工作。
但在 x
或 y
overflow
hidden
则不然
这是代码:
HTML:
<div class="wrapper">
<div id="sec1" class="section">dfa fdasfsdafd as</div>
<div id="sec2" class="section">dfa fdasfsdafd as</div>
<div id="sec3" class="section">dfa fdasfsdafd as</div>
<div id="sec4" class="section">dfa fdasfsdafd as</div>
</div>
CSS:
html, body, .wrapper, .section{
height:100%;
}
.wrapper{
overflow-x: hidden;
overflow-y: auto;
}
JS:
$('#sec3').waypoint(function(direction) {
$('#sec3').css({
backgroundColor: "#f99"
});
});
有任何 jQuery 或 CSS 解决方案吗?
最佳答案
更新于 2014 年 5 月 16 日
添加waypoint()
函数绑定(bind)到<div>
id 使 css 更改出现。
waypoint()
的背景应该是你的外部 div <div class="wrapper">
:
<强> DEMO
关于jquery - 溢出时路点无法工作 :hidden;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23563016/