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. Commented Jul 19, 2013 at 9:01
  • 1
    And for the animation you should check this out: yearofmoo.com/2013/04/animation-in-angularjs.html Commented Jul 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 ! :) Commented Jul 19, 2013 at 14:46
  • The website sure is nice but it is not mine, I just found it on google :) Commented Jul 19, 2013 at 14:54

1 Answer 1

3

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

documentation

nganimate.org

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.