Prevent angularjs animation from running on elemen

2019-07-18 19:36发布

This question already has an answer here:

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

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.

1条回答
男人必须洒脱
2楼-- · 2019-07-18 20:06

Is this something you're looking for?

http://codepen.io/anon/pen/JaHKL

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

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.

Hope it helps.

查看更多
登录 后发表回答