自己动手写fullPage插件

仿造fullPage.js https://alvarotrigo.com/fullPage/#firstPage

自己参照网上教程写了一个,加了注释。主要是练习造轮子的能力,需求是不断变化的只拿来用的话谁都会,只有掌握了核心的技术,遇到复杂的需求才不会犯难。以后会按照官网逐渐完善其他功能。欢迎star。

demo:https://hwlv.github.io/myplugin/fullpage/index.html

github:https://github.com/hwlv/myplugin/tree/master/fullpage

使用方法

<script src="js/fullpage.js"></script>
<div id="container" data-PageSwitch="">
    <div class="sections">
        <div class="section" id="section0">page321</div>
        <div class="section" id="section1"></div>
        <div class="section" id="section2"></div>
        <div class="section" id="section3"></div>
    </div>
</div>
   $('#container').PageSwitch({
        direction:'vertical',//horizontal,vertical
        loop:true,
        easing:'ease-in-out',
        duration:'700'
    });
原文地址:https://www.cnblogs.com/lvhw/p/7503203.html