使用ng-show和ng-animate向上/向下滑动效果 [英] Slide up/down effect with ng-show and ng-animate

查看:497
本文介绍了使用ng-show和ng-animate向上/向下滑动效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用 ng-animate 获得类似于JQuery的 slideUp() code> slideDown()。只是我宁愿使用 ng-show

I'm trying to use ng-animate to get a behavior similar to JQuery's slideUp() and slideDown(). Only I'd rather use ng-show

我在这里查看ng-animate教程 - a href =http://www.yearofmoo.com/2013/04/animation-in-angularjs.html> http://www.yearofmoo.com/2013/04/animation-in-angularjs.html < a>,

I'm looking at the ng-animate tutorial here - http://www.yearofmoo.com/2013/04/animation-in-angularjs.html,

,我可以在提供的示例中重现淡入/淡出效果。

and I can reproduce the fade in/out effect in the example provided.

我改变CSS以获得滑动上/下行为?
另外,如果可能,更好的是css不知道组件的高度(以像素为单位)。
我可以为不同的元素重用css。

How could I change the css to get slide up/down behaviour? Also, if possible, it's better that the css doesn't know about the component height in pixels. That way I can reuse the css for different elements.

推荐答案

我写了一个Angular指令, ()没有jQuery。

I've written an Angular directive that does slideToggle() without jQuery.

https://github.com / EricWVGG / AngularSlideables

这篇关于使用ng-show和ng-animate向上/向下滑动效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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