您当前的位置: 首页 >  动画

彭世瑜

暂无认证

  • 3浏览

    0关注

    2791博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

css:animate.css@4.1.1和wow.js实现网页动画效果

彭世瑜 发布时间:2021-11-18 17:27:28 ,浏览量:3

需要注意的是animate.css 3.x版本和4.x版本的使用方法稍有不同 4.x版本增加了一个前缀animate__减少样式冲突

文档
  • wow.js: https://wowjs.uk/docs.html
  • animate.css: https://animate.style/
CDN
  • https://www.bootcdn.cn/wow/
  • https://www.bootcdn.cn/animate.css/

通过以下代码就能很容易实现一个加载动画





.box {
  width: 300px;
  height: 300px;
  background-color: #eeeeee;
}






如果元素不在第一屏幕,就不能看到动画效果,可以通过wow.js解决



  
    .box {
      width: 300px;
      height: 300px;
      background-color: #eeeeee;
      /* 让元素在下一屏幕显示 */
      margin-top: 1000px;
    }
  

  
  

  
  
  
    var wow = new WOW({
      boxClass: 'wow',
      animateClass: 'animate__animated',
      offset: 0,
      mobile: true,
      live: true
    });
    wow.init();
  

在线Demo:https://mouday.github.io/front-end-demo/animate-wow.html

关注
打赏
1665367115
查看更多评论
立即登录/注册

微信扫码登录

0.1798s