Angular Animate slide pages in from right and out to right side (nganimate)

。_饼干妹妹 提交于 2019-12-02 17:16:38

问题


I'm working on a school project using Angular.js. We also have to implement some animations in our website. Since my website is kind of master-detail, I would like to slide the detail page (which is a separately routed page) to slide in from right. This is not really a problem. But when I would go back to the 'master' page the master page would slide in from right. I'd much rather like the master page to slide in from left.

Is there any way to get a specific ng-view animation depending on the page? I'd like to use CSS animations but that's more of a detail.

I'm working with an index.html page with an ng-view in which a template gets loaded according to which page is navigated to.

Hope anyone can help me, thanks!


回答1:


I've found an article about animations on ng-View: http://scotch.io/tutorials/animating-angularjs-apps-ngview

You simply have to add a class on the ng-view container

<div class="page {{ pageClass }}" ng-view></div>

and in your Controllers

$scope.pageClass="pageName";


来源:https://stackoverflow.com/questions/27648895/angular-animate-slide-pages-in-from-right-and-out-to-right-side-nganimate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!