vue添加animate.css动画

vue添加animate.css动画

1、首先在vue的index.html引入在线cdn的animate.css文件(第一种)

animate.css

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

或自己下载后放到vue项目的静态文件夹中

辅助类

给你想添加动画效果的元素添加一个 animated 类(必需)。如果需要动画循环运动,你还需要给这个元素追加 infinite 类,又或者自己另外定义一个类似于 infinite 的类。

效果添加

bounce
flash
pulse
rubberBand
shake
headShake
swing
tada
wobble
jello
bounceIn
bounceInDown
bounceInLeft
bounceInRight
bounceInUp
bounceOut
bounceOutDown
bounceOutLeft
bounceOutRight
bounceOutUp
fadeIn
fadeInDown
fadeInDownBig
fadeInLeft
fadeInLeftBig
fadeInRight
fadeInRightBig
fadeInUp
fadeInUpBig
fadeOut
fadeOutDown
fadeOutDownBig
fadeOutLeft
fadeOutLeftBig
fadeOutRight
fadeOutRightBig
fadeOutUp
fadeOutUpBig
flipInX
flipInY
flipOutX
flipOutY
lightSpeedIn
lightSpeedOut
rotateIn
rotateInDownLeft
rotateInDownRight
rotateInUpLeft
rotateInUpRight
rotateOut
rotateOutDownLeft
rotateOutDownRight
rotateOutUpLeft
rotateOutUpRight
hinge
rollIn
rollOut
zoomIn
zoomInDown
zoomInLeft
zoomInRight
zoomInUp
zoomOut
zoomOutDown
zoomOutLeft
zoomOutRight
zoomOutUp
slideInDown
slideInLeft
slideInRight
slideInUp
slideOutDown
slideOutLeft
slideOutRight
slideOutUp

示例

<h1 class="animated infinite bounce">Example</h1>  //animated 必须的  infinite 循环  bounce动画效果

jQuery 基本用法

1.$('#yourElement').addClass('animated bounceOutLeft');

2.vue(第二种)

第一步:安装:

在命令行中执行:npm install animate.css --save

第二步:引入及使用:

main.js中:
 
import animated from 'animate.css' // npm install animate.css --save安装,在引入
 
Vue.use(animated)

使用


vue模板中:
<div class="ty">
    <!-- 直接使用animated中的动画class名,注意:必须使用animated这个class名,否则动画会无效 -->
	<div class="box animated bounceInDown"></div>
</div>

Vue过渡官网

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值