首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >animate.css 官方,animateCSS

animate.css 官方,animateCSS

作者头像
全栈程序员站长
发布2022-09-18 14:20:22
发布2022-09-18 14:20:22
1.6K0
举报

大家好,又见面了,我是你们的朋友全栈君。

animateCSS是什么

什么是animateCSS,Animate CSS jQuery Plugin

animateCSS官网:官网

animateCSS文档:文档

animateCSS源码仓库:源码仓库

animateCSS下载地址:点此下载 点此下载2

animateCSS介绍、animateCSS使用

A jQuery plugin to dynamically apply Dan Eden’s animate.css animations with callbacks

Getting Started

Bower

Install with Bower bower install animateCSS

Download

In your web page:

$(document).ready( function(){

$(‘#your-id’).animateCSS(“fadeIn”);

});

Documentation

{

infinite: false, // True or False

animationClass: “animated”, // Can be any class

delay: 0 // Can be any value (in ms)

duration: 1000 // Can be any value (in ms)

callback: // Any function

}

When using infinite: true and a delay, the delay will only occur before the first loop, not on every loop.

Examples

Basic

$(‘#your-id’).animateCSS(‘fadeIn’);

With callback

$(‘#your-id’).animateCSS(‘fadeIn’, function(){

console.log(‘Boom! Animation Complete’);

});

With delay (in ms)

$(‘#your-id’).animateCSS(‘fadeIn’, {delay: 500});

With delay AND callback

$(‘#your-id’).animateCSS(‘fadeIn’, {

delay: 1000,

callback: function(){

console.log(‘Boom! Animation Complete’);

}

});

With duration (in ms)

$(‘#your-id’).animateCSS(‘fadeIn’, {duration: 3000});

Chain multiple animations

If you use the standard jQuery chaining mechanism, each animation will fire at the same time so you have to include the next animation in the callback.

$(‘#your-id’).animateCSS(‘fadeInUp’, function() {

console.log(‘Boom! First animation Complete’);

$(this).animateCSS(“fadeOutUp”, function(){

console.log(‘Boom Boom! Second animation Complete’);

})

});

Offset animations

You can offset animations by using the delay mechanism

$(‘#your-id’).animateCSS(‘fadeIn’);

$(‘#another-id’).animateCSS(‘fadeIn’, {delay:100});

If you want to hide an element when the page loads and then apply an effect, it might look something like this:

.js #your-id {

visibility:hidden;

}$(window).load( function(){

$(‘#your-id’).animateCSS(‘fadeIn’, function(){

console.log(‘Boom! Animation Complete’);

});

});

Release History

Please consult the official changelog

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/157802.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档