通过js滚轮滚动时调用动画_JS函数库:页面滚动过程中元素产生动画效果 WOW.js...

WOW.js依赖animate.css, 所以它支持animate.css多达60多种动画效果。

浏览器兼容:IE9以及以前的版本不适用

使用方法:

1、引入文件

2、HTML

1,Make an element revealable

Add the CSS class .wow to a HTML element: it will be invisible until the user scrolls to reveal it.

(You can change this CSS class in the WOW settings to avoid name conflicts.)

Content to Reveal Here

2,Choose the animation style

Pick an animation style inAnimate.css, then add the CSS class to the HTML element

Content to Reveal Here

可以加入data-wow-duration(动画持续时间)和 data-wow-delay(动画延迟时间)属性,如:

data-wow-duration:Change the animation durationdata-wow-delay:Delay before the animation startsdata-wow-offset:Distance to start the animation (related to the browser bottom)data-wow-iteration:Number of times the animation is repeated

3、JavaScript

new WOW().init();

如果需要自定义配置,可如下使用:

var wow = new WOW({//以下都是默认值

boxClass: 'wow',

animateClass: 'animated',

offset: 0,

mobile: true,

live: true

});

wow.init();

boxClass:Class name that reveals the hidden box when user scrolls.

animateClass:Class name that triggers the CSS animations (’animated’ by default for the animate.css library)

offset:Define the distance between the bottom of browser viewport and the top of hidden box.

When the user scrolls and reach this distancethe hidden box is revealed.

mobile:Turn on/off WOW.js on mobile devices.

live:consatantly check for new WOW elements on the page.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值