【问题标题】:AngularJS 1.3, ngAnimate and animate.cssAngularJS 1.3、ngAnimate 和 animate.css
【发布时间】:2014-10-12 07:23:59
【问题描述】:

这里是菜鸟 :) 尝试设置一个 ngAnimation ,除了一件烦人的事情外,它基本上可以正常工作。 当页面加载时,ng-hide 动画正在运行。

如何防止这种情况发生?

代码如下: html:

<form name="signup_form" novalidate>

                <!-- USERNAME -->
                <label class="item item-input ">
                    <input type="text" placeholder="Username" name="username" ng-model="newUser.username" autocapitalize="off" autocorrect="off" ng-minlength=4 ng-maxlength=20  required/>
                </label>
                <div class="error" ng-show="signup_form.username.$dirty && signup_form.username.$invalid">
                    <small class="error" ng-show="signup_form.username.$error.required">Username is required.</small>
                    <small class="error" ng-show="signup_form.username.$error.minlength">Your name is required to be at least 4 characters</small>
                    <small class="error" ng-show="signup_form.username.$error.maxlength">Your name cannot be longer than 20 characters</small>
                </div>

这是css

.error {
    color: #F00;
    background: #F5F5F5;
    text-align: center;
}

.error.ng-show {
    -webkit-animation: bounceIn 1s;
    -moz-animation: bounceIn 1s;
    -ms-animation: bounceIn 1s;
    animation: bounceIn 1s;
}
.error.ng-hide {
    -webkit-animation: bounceOut 1s;
    -moz-animation: bounceOut 1s;
    -ms-animation: bounceOut 1s;
    animation: bounceOut 1s;
}

还尝试使用 ng-cloak 指令,但没有帮助。 将不胜感激任何帮助。非常感谢。

【问题讨论】:

标签: css angularjs ng-animate


【解决方案1】:

由于找不到原因,我从头开始,效果很好。 真的不知道发生了什么。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-16
    • 1970-01-01
    • 2017-08-01
    • 2015-04-01
    • 1970-01-01
    相关资源
    最近更新 更多