prevent从单元上运行angularjs的动画最初是隐藏加载时 [英] Prevent angularjs animation from running on element that is initially hidden when loaded

查看:160
本文介绍了prevent从单元上运行angularjs的动画最初是隐藏加载时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的http://$c$cpen.io/cflynn07/pen/hbgxf

^示例

http://codepen.io/cflynn07/pen/hbgxf
^ Example

我有一个angularjs动画,我不希望它因为这是应该被隐藏的元素在页面加载运行。

I have an angularjs animation, and I don't want it to run on page load for an element that is supposed to be hidden.

目前,该元素所示,则出现向上滑动动画和隐藏的元素。

Right now, the element is shown, then the slide up animation occurs and hides the element.

推荐答案

这是不是你要找的?

的http://$c$cpen.io/anon/pen/JaHKL

基本上你需要设置风格=显示:无;宣布初始状态。

Basically you need set style="display: none;" to declare the initial state.

否则,初始状态为显示:内联当AngularJS读数据-NG-秀=FALSE,就会引发你的隐藏动画,以配合您的设置。

Otherwise the initial state will be display:inline and when AngularJS reads data-ng-show="false", it will trigger your hide animation in order to match your setting.

希望它帮助。

这篇关于prevent从单元上运行angularjs的动画最初是隐藏加载时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆