简体   繁体   English

如何在AngularJS中进行slideDown或slideUp

[英]How can I do slideDown or slideUp in AngularJS

This my code: 这是我的代码:

 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 

 $(function () { $('a').click(function (e) { e.preventDefault(); $('div').slideUp(); $("#box_" + $(this).attr("href")).slideDown(); $(this).addClass("active"); return false; }); }); 
 .hide{ display:none; } 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <a href="01">Open Box 01</a> <div id="box_01" class="hide"> Box 01 </div> <a href="02">Open Box 02</a> <div id="box_02" class="hide"> Box 02 </div> 

you might want to look into the ngAnimate , the angular animation library. 您可能需要研究ngAnimate (角度动画库)。

This is a good tutorial. 是一个很好的教程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM