美文网首页
fullpagejs实现的拥有header和foooter的全屏

fullpagejs实现的拥有header和foooter的全屏

作者: stumpx | 来源:发表于2018-08-30 17:30 被阅读0次

fullpagejs实现的拥有header和foooter的全屏滚动,


技术要点:给section元素加fp-auto-height类,

效果图
动态效果图
代码
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>fullpage footer</title>
    <link href="https://cdn.bootcss.com/fullPage.js/2.9.5/jquery.fullpage.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.js"></script>
    <script src="https://cdn.bootcss.com/fullPage.js/2.9.5/jquery.fullpage.js"></script>
    <style> .section { text-align: center; font: 30px "Microsoft Yahei"; color: #fff;
        } .header, .footer { height: 100px;
        }
    </style>
    <script> $(function () {
            $('#stumpx').fullpage({
                sectionsColor: ['#1bbc9b', '#4BBFC3', '#7BAABE', '#f90']
            });
        }); </script>
</head>
<body>
<div id="stumpx">
    <div class="section fp-auto-height header">
        <h3>第一屏 header</h3>
    </div>
    <div class="section">
        <h3>第二屏</h3>
    </div>
    <div class="section">
        <h3>第三屏</h3>
    </div>
    <div class="section fp-auto-height footer">
        <h3>第四屏 footer</h3>
    </div>
</div>
</body>
</html>

本文链接:https://www.jianshu.com/p/8ebaa9360322
原文链接:https://www.cnblogs.com/stumpx/p/7986359.html

相关文章

网友评论

      本文标题:fullpagejs实现的拥有header和foooter的全屏

      本文链接:https://www.haomeiwen.com/subject/kuedwftx.html