• jQuery全屏滚动插件fullPage.js


    今天做了一个专题,需要用到全屏滚动效果,在百度找了一jquery插件,fullPage.js,只有一天的时间就要完成,只是简单的了解下就开始做专题了。

    demo地址:http://alanjs.comeze.com/2014No1/index.html

    插件API:http://www.dowebok.com/77.html

    下载地址:https://github.com/alvarotrigo/fullPage.js


    1.引入jquery.fullPage.min.js文件
    2.引入jquery.fullPage.css文件
    3.引入jquery.easing.min.js文件

    JS调用

    复制代码
    $(function(){
        $('#dowebok').fullpage({
        verticalCentered: false,      //内容居中
            anchors: ['page1', 'page2', 'page3', 'page4', 'page5', 'page6', 'page7'],    //锚
            navigation: true,       //是否有导航
            navigationTooltips: ['首页', '视觉', '交互', '皮肤', '功能', '待办邮件', '联系人邮件']
    
        //如果IE版本小于10就在body添加ltie10,然后样式中会用.ltie .class平缓退化
        if($.browser.msie && $.browser.version < 10){
                 $('body').addClass('ltie10');
            }
        });
    });
    复制代码


    HTML

    复制代码
    <div id="dowebok">
        <div class="section section1">
        <div class="bg">
            <div class="page2_bg1"></div>
            <div class="page2_bg2"></div>
            <div class="page2_bg3"></div>
        </div>
        </div>
        <div class="section section2">第二屏</div>
        <div class="section section3">
            <div class="slide slide1">第三屏的第一屏</div>
            <div class="slide slide2">第三屏的第二屏</div>
            <div class="slide slide3">第三屏的第三屏</div>
            <div class="slide slide4">第三屏的第四屏</div>
        </div>
        <div class="section section4">第四屏</div>
    </div>
    复制代码

    CSS

    如果有调用导航小图标,会有默认样式,如想要改变样式,则参考如下

    复制代码
    <style>
    #container{min-1003px;}
    #fullPage-nav{_display:none;font-size:12px;}
    #fullPage-nav li{30px;height:30px;}
    #fullPage-nav li a { float: right;  26px; height: 26px; color: #8F9DA4; text-decoration: none; text- 
    align: right; background: url(images/icon.png) 0 -155px no-repeat;}
    #fullPage-nav li .active { background-position: 0 -192px; }
    #fullPage-nav span { display: none;}
    .fullPage-tooltip { float: left; top: 0; font: 12px "Microsoft Yahei"; color: #8F9DA4; line-height: 26px;}
    .section .bg img{100%;height:100%;display:block;}
    </style>
    复制代码

     回调函数

    复制代码
    afterLoad: function (anchorLink, index) {
       //index为页数,值为number   
    }
    onLeave: function (index, nextIndex, direction){
            //direction为方向,取值为“down",”up"
    }
    复制代码
    Windy心梦无痕
  • 相关阅读:
    15 手写数字识别-小数据集
    14 深度学习-卷积
    5.线性回归算法
    9、主成分分析
    8、特征选择
    4.K均值算法--应用
    6.逻辑回归
    12.朴素贝叶斯-垃圾邮件分类
    13、垃圾邮件2
    大数据应用期末总评
  • 原文地址:https://www.cnblogs.com/windy-xmwh/p/8279621.html
Copyright © 2020-2023  润新知