3

I have an app in AngularJS and in one of my view I want to implement some JQuery animation..nothing too fancy..just hide/slide of a divs ..those divs are created from ng-reapet loop and I need access to DOM elements in order to write my JQuery . Where shall I put my code controller or directive ? An exemple of my code:

$(document).ready(function(){ $(".motivation").hide(); $(".show_hide").show(); }); $(document).on("click", ".more", function(){ $(this).parent().next().slideToggle(); return false; }); 
4
  • 1
    If you are using angular then you shouldn't be using jQuery to bind click events on your DOM, you should do it the angular way and use ng-click in your HTML.
    – Yann
    CommentedJul 19, 2013 at 9:01
  • 1
    And for the animation you should check this out: yearofmoo.com/2013/04/animation-in-angularjs.html
    – Yann
    CommentedJul 19, 2013 at 9:08
  • Yep I use the exemple from your site and it worked straight way with no effort - thanks a lot and beautiful website u got ! :)CommentedJul 19, 2013 at 14:46
  • The website sure is nice but it is not mine, I just found it on google :)
    – Yann
    CommentedJul 19, 2013 at 14:54

1 Answer 1

3

With the beta version of AngularJS, you can use ng-animate.

documentation

nganimate.org

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.