JS函数库:页面滚动过程中元素产生动画效果 WOW.js

官网

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

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

使用方法:

1、引入文件

<link rel="stylesheet" href="css/animate.min.css" />

<script type="text/javascript" src="js/wow.min.js"></script>

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.)

<div class="wow">
Content to Reveal Here
</div>

2,Choose the animation style

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

<div class="wow bounceInUp">
Content to Reveal Here
</div>

<div class = "wow slideInLeft"></div>

<div class = "wow slideInRight"></div>

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

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

<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();

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

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 distance the hidden box is revealed.

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

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

时间: 2024-12-26 17:04:25

JS函数库:页面滚动过程中元素产生动画效果 WOW.js的相关文章

使页面滚动到指定元素+优化+API介绍(JS动画)

前言 当页面最上部有顶部菜单是,使用锚点跳转的方法很容易挡住想要呈现的内容(如下图技能两个字被挡住了一半),为避免出现这样的问题,故滚动到指定元素使用用JS的方法来实现. 1  使用的API简介 document.querySelectorAll preventDefault currentTarget getAttribute document.querySelector offsetTop window.scrollTo 2  初版 代码及思路如下: //1 点击导航跳到指定位置第一步,获取

aos.js超赞页面滚动元素动画jQuery动画库

插件描述:aos.js是一款效果超赞的页面滚动元素动画jQuery动画库插件.该动画库可以在页面滚动时提供28种不同的元素动画效果,以及多种easing效果.在页面往回滚动时,元素会恢复到原来的状态. 简要教程 aos.js是一款效果超赞的页面滚动元素动画jQuery动画库插件.该动画库可以在页面滚动时提供28种不同的元素动画效果,以及多种easing效果.在页面往回滚动时,元素会恢复到原来的状态. AOS.js 下载          案例演示 安装 可以通过bower来安装aos动画库插件.

[jQuery编程挑战]001:实现页面元素加速动画效果

要求: 页面包含两个HTML元素:一个按钮,一个小方块 动画要求:点击按钮,小方块从页面坐标300,300,加速移动到0,0 相关知识点: jQuery动画方法animate easing参数的设置 <!DOCTYPE html> <html lang="zh"> <head> <meta charset="utf-8"> <title>实现页面元素加速动画效果</title> <styl

jQuery页面滚动监听事件及高级效果插件

jQuery页面滚动监听事件及高级效果插件 1. One Page scroll (只适用于上下焦点图)http://www.thepetedesign.com/demos/onepage_scroll_demo.html 2. Scrolld(更不好用)https://github.com/charliegeiger89/Scrolld.js#readme 3. Animate Scroll(参数太少,不好用)https://github.com/ramswaroop/animatescrol

页面跳转的时候有动画效果

原来在跳转到另外一个页面的时候,是可以有动画效果的.上代码. -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { /* 1,不使用动画 UIViewAnimationTransitionNone 2,从左向右旋转翻页 UIViewAnimationTransitionFlipFromLeft 3,从右向左旋转翻页,与UIViewAnimationTransitionFlipFromLeft相反 UIViewAnima

tween.js可生成平滑动画效果的js动画库

tween.js是一款可生成平滑动画效果的js动画库.tween.js允许你以平滑的方式修改元素的属性值.它可以通过设置生成各种类似CSS3动画效果.相关的jquery插件还有:snabbt.js 强大的jQuery动画库插件和Tweene-超级强大的jQuery动画代理插件. tween.js允许你以平滑的方式修改元素的属性值.你只需要告诉tween你想修改什么值,以及动画结束时它的最终值是什么,动画花费多少时间等信息,tween引擎就可以计算从开始动画点到结束动画点之间值,来产生平滑的动画效

android中设置Animation 动画效果

在 Android 中, Animation 动画效果的实现可以通过两种方式进行实现,一种是 tweened animation 渐变动画,另一种是 frame by frame animation 画面转换动画,接下来eoe进行讲解. tweened animation 渐变动画有以下两种类型: 1.alpha   渐变透明度动画效果 2.scale   渐变尺寸伸缩动画效果 frame by frame animation 画面转换动画有以下两种类型: 1.translate  画面转换位置

页面滚动图片等元素动态加载插件jquery.scrollLoading.js

如果一个网页很长,那么该页面的加载时间也会相应的较长.而这里给大家介绍的这个jQuery插件scrollLoading的作用则是,对页面元素进行动态加载,通俗的说就是滚到哪就加载到哪,屏幕以下看不见的就不用加载了.这样还可以在一定程度上节省服务器资源.该插件作者的网页将该插件的功能和使用方法描述的非常详细,这里把最一般最普遍的使用情况给大家展现一下. 插件作者:http://www.zhangxinxu.com/ 首先我们需要加载jQuery库和本插件js文件. (jquery.scrollLo

iframe子页面js调用父页面js函数/父页面调用Iframe子页面中js方法

1.假设当前页面为a.html, iframe的src页面为b.html,其代码如下: 1 <span class="tag"><html> 2 <br></span><span class="tag"><head> 3 <br></span><span class="tag"><title></span><s