【问题标题】:Fullpage.js Scroll Overflow not working when horizontal slider added添加水平滑块时,Fullpage.js 滚动溢出不起作用
【发布时间】:2015-07-16 01:13:36
【问题描述】:

我在我的网站上使用 fullpage.js。我有几个很长的页面并添加了 scrollOverflow: true 以使这些页面完全可滚动。在我合并一个水平滑块之前效果很好,然后 scrollOverflow 停止工作。我知道可以有一个使用 scrollOverflow 和水平滑块的页面,因为 Alvaro 在他的网站 (http://www.alvarotrigo.com/fullPage/examples/scrolling.html#secondPage) 上演示了它,但我似乎无法让它工作。这是一个简单的示例,您无法滚动到第 1 页第二个绿色框的底部;而是流到第 2 页:

<div id="fullpage">

<div class="section">
   <div id="clients">
        <div id="logosTop"></div>

        <div id="logosBottom"></div>

        <div id="slider">
            <div class="slide">Text here</div>
            <div class="slide">Text here</div>
            <div class="slide">Text here</div>
            <div class="slide">Text here</div>
        </div>
    </div>
</div>

<div class="section">Some section</div>  
</div>

<script type="text/javascript">
$(document).ready(function() {
$('#fullpage').fullpage( {
scrollOverflow: true,
verticalCentered: false,
});
});

CSS:

#clients {
position: relative;
width: 750px;
height: 100%;
left: 50%;
margin-left: -375px;
}


#logosTop {
background-color:#096;
width: 1025px;
height: 235px;
position: absolute;
margin-top: 50px;
margin-left: -137px;
}

#logosBottom {
background-color:#096;
width: 1025px;
height: 340px;
position: absolute;
margin-top: 715px;
margin-left: -137px;
}

#slider {
position: absolute;
margin-top: 450px;
width: 740px;
margin-left: 5px;
}

.slide {
font-family: Arial;
font-size: 15px;
}

【问题讨论】:

  • 你找到解决这个问题的方法了吗?

标签: jquery fullpage.js


【解决方案1】:
#slider {
    position: absolute;
    margin-top: 450px;
    width: 740px;
    margin-left: 5px;
}

那里要小心。您正在使用 absolute 位置,因为这会将它们移出页面结构,并且 fullPage.js 将无法检测到幻灯片内容的高度。

【讨论】:

  • 感谢您的回复。我尝试使用相对定位并为所有 div 定义高度,但它没有改变任何东西。如果内容高于浏览器窗口,我仍然无法滚动到内容的底部。如果我取出水平滑块,它工作正常。当我重新添加它时,它不起作用。
  • 抱歉,如果您想让我们知道发生了什么,您必须在 jsfiddle 中提供重现问题或添加指向您网站的链接。
  • 这是网站:www.backstories.tv/indexAlt.html 我遇到问题的页面是名为“clients”的页面
猜你喜欢
  • 2015-12-31
  • 2015-06-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-01-14
  • 1970-01-01
  • 2013-11-16
相关资源
最近更新 更多