jquery - 页脚不显示在 div 幻灯片的末尾

标签 jquery html css fullpage.js

分割结束后页脚丢失。

<div id="fullpage">
  <div class="section " id="section0"> content1 </div>
  <div class="section " id="section0"> content1 </div>
  <div class="section " id="section0"> content1 </div>
  <div class="section " id="section0"> content1 </div>
</div>
<footer> this is my footer </footer>

这是我的脚本

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

我使用整页 js 滚动工作顺利,但页脚不显示。

最佳答案

默认情况下,fullpage 不支持您尝试的这种页脚解决方案。我对原来的fullpage.js做了一个简单的扩展,支持这个。

            if (v.anchorLink == 'footer')
            {
                footer_a = $('#section-footer').height();
                footer_h = $('#footer-text').height();
                var translate3d = 'translate3d(0px, -' + (v.dtop - footer_a + footer_h) + 'px, 0px)';
            }
            else
            {
                var translate3d = 'translate3d(0px, -' + v.dtop + 'px, 0px)';
            }

你可以试试:link

页脚高度由其中的文本计算。

关于jquery - 页脚不显示在 div 幻灯片的末尾,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24424044/

相关文章:

javascript - 如何在单击按钮时滚动回页面顶部?

javascript - jquery ui可与angularjs排序,如何防止水平拖放?轴 :y not working

javascript - 以编程方式设置数字输入值不起作用

javascript - 变量到另一个变量得到 “undefined”

html - Materialise textarea 标签在固定高度上不可滚动

javascript - 为什么这个点击事件触发了错误的元素?”

rest - OData substringof 或startswith 返回所有项目

html - 为什么我的下拉列表不起作用?

javascript - jQuery 数字计数器

html - 构建小部件 (HTML/CSS)——表格还是 div?