I have a single page application that uses Angular JS routing. On an element in one of the dynamically loaded views, I would like to apply a jQuery animation. Simply including a jQuery script at the bottom of the page is not sufficient because it should theoretically only be called once.
However, that being the case I can't even get it to call the first time. I have the following code...
jQuery:
$("#main-content-overlay").fadeIn().animate({top:65}, 500);
HTML:
<img src="images/home/main-content-background.jpg" id="main-content" />
<img src="images/home/main-content-overlay.png" id="main-content-overlay" />
Again, the aforementioned HTML is part of a view that is loaded dynamically by Angular. I would like my animation to be applied every time the route changes, but I can't even get the animation to work on the first load.
ng-animate, it has a lot of great ways to handle stuff like this if you don't mind doing the animations in css.