css - AngularJS 1.3、ngAnimate 和 animate.css

标签 css angularjs ng-animate

菜鸟在这里 :) 尝试设置一个 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 1.3、ngAnimate 和 animate.css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25379261/

相关文章:

javascript - 固定按钮在滚动后失去功能

javascript - 使用 webpack 为 Angular 应用程序编译 scss

javascript - 如何检查字段的有效性,选择的值不能相同?

javascript - Protractor - 当子元素也是页面中其他地方的主要元素时如何在元素内找到元素

javascript - 无法在嵌套的 ngRepeat 上触发动画

css - 在没有 "snapping"的情况下,如何淡出一个元素并淡入另一个元素?

css - 使用 CSS 样式化滚动条

html - CSS 排除语法

css - 使用 ng-animate 时偏移占位符元素的正确方法是什么?

css - 如何在 JavaFx Spring 应用程序中包含 css 文件