如何在javascript中添加过渡效果
How to add transition effect in javascript?
我想在代码中添加转换效果。当error
css出现时,它应该添加转换,但我无法应用它。我知道悬停时如何添加转换,但是我不知道如何处理这种情况?
这是我的css
.error{
width:300px;
height:100px;
background: red;
-webkit-transition:all linear 0.5s;
transition:all linear 0.5s;
}
Html
<div ng-app='app' ng-controller='appCtrl'>
<form name="myForm" >
userType: <input name="input" ng-model="userType" required>
<div class="error" ng-show="myForm.input.$error.required">
<p>err</p>
</div>
</form>
</div>
小提琴http://jsfiddle.net/8atm9bdb/1/
好的,我发现了我的错误。ngAnimate
可以实现大部分的跃迁效应
.error.ng-hide-add.ng-hide-add-active,
.error.ng-hide-remove.ng-hide-remove-active {
-webkit-transition: all linear 0.5s;
transition: all linear 0.5s;
}
http://www.nganimate.org/
相关文章:
- 如何在服务、技能、投资组合等方面添加滑动效果
- 在d3.js圆中添加阴影效果
- 滚动延迟页面过渡效果
- 为计数器添加滑动效果
- 照片滑动:关闭图库会为错误的矩形(缩略图)添加动画效果
- 在多条测地线折线上为符号添加动画效果
- 在 JavaScript 中为其添加动画效果时更改图像颜色
- 如何根据上一个或下一个箭头为nivo滑块提供特定的过渡效果
- 当我尝试添加文本效果时,有东西阻止了JavaScript的运行'手风琴'在html文档中
- 如何在javascript中添加过渡效果
- 如何为幻灯片添加过渡
- 在它们停止工作后恢复过渡效果
- 如何在没有过渡效果的情况下使用fancybox调整大小
- 加载新页面时的过渡效果,AJAX
- 覆盖ColorBox打开/关闭过渡效果
- 在toggleclass上添加fadeIn效果
- 带有onclick的CSS3过渡效果
- 添加渐变过渡效果和自动图像更改
- 如何在打开自定义模式窗口时添加过渡效果
- 在我的图像滑块上添加过渡效果