animation css 透明度逐渐_CSS透明度动画AngularJS

I'm new to Angular and I'm trying not to depend on jQuery for this fadeIn animation I want.

I've tried ng-animate and .fade-enter + .fade-enter.fade-enter-active, but I'm getting nowhere.

my footer CSS looks like this:

footer {

opacity: 0.3;

text-align: center;

}

And I'm trying to animate it such that opacity goes to 1 in 2 seconds.

This is the version of Angular I am running:

How would I do this animation with Angular and CSS and without jQuery?

解决方案

Here's an example of how to do a fade in/out animation in Angular 1.1.5:

HTML

Show/Hide

Hello {{name}}!

CSS

.fade-hide, .fade-show {

-webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;

-moz-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;

-o-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;

transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;

}

.fade-hide {

opacity:1;

}

.fade-hide.fade-hide-active {

opacity:0;

}

.fade-show {

opacity:0;

}

.fade-show.fade-show-active {

opacity:1;

}

Plunker here.

This blog post has good information on animations in Angular 1.1.5. And I suggest taking a look at the new animation system released in Angular 1.2 RC1.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值