zoukankan      html  css  js  c++  java
  • WOW.js和animate.css让页面滚动时显示动画

    官网:http://mynameismatthieu.com/WOW/

    bootstrap CDN服务:http://www.bootcdn.cn/wow/

    1.wow.js

    实现了在网页滚动时的动画效果,有漂亮的动画效果,依赖于Animate.css。

    2.Animate.css (下载https://daneden.github.io/animate.css/)
    非常优秀的CSS3动画库,不依赖于jQuery,纯CSS动画


    使用方法

    1、引入文件
    <link rel="stylesheet" href="css/animate.min.css">  


    2、HTML
    <div class="wow slideInLeft"></div>  
    <div class="wow slideInRight"></div>  
    可以加入 data-wow-duration(动画持续时间)和 data-wow-delay(动画延迟时间)属性,如:
    <div class="wow slideInLeft" data-wow-duration="2s" data-wow-delay="5s"></div>  

    <div class="wow slideInRight" data-wow-offset="10"  data-wow-iteration="10"></div>  

    3、javascript

    new WOW().init();  

    如果需要自定义配置,可如下使用:
    [javascript] view plain copy
    var wow = new WOW({  
        boxClass: 'wow',  
        animateClass: 'animated',  
        offset: 0,  
        mobile: true,  
        live: true  
    });  
    wow.init();  


    配置
    属性/方法 类型 默认值 说明
    boxClass 字符串 ‘wow’ 需要执行动画的元素的 class
    animateClass 字符串 ‘animated’ animation.css 动画的 class
    offset 整数 0 距离可视区域多少开始执行动画
    mobile 布尔值 true 是否在移动设备上执行动画
    live 布尔值 true 异步加载的内容是否有效

  • 相关阅读:
    环境变量不重启生效
    egret list不显示问题
    批处理收集
    吐槽阿里云数据库的备份还原
    一次没清缓存的坑
    imagepng或imagejpeg浏览器无显示问题
    xdebug调试一直等待连接
    Python快速学习07:文本文件的操作
    Python快速学习06:词典
    纸上谈兵: AVL树[转]
  • 原文地址:https://www.cnblogs.com/aimyfly/p/9049322.html
Copyright © 2011-2022 走看看