本文介绍了路线过渡angularjs之间的滑动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只一直在与角大约一个星期,所以我道歉,如果我的code是废话。
I've only been working with Angular for about a week, so I apologize if my code is crap.
我试图创建路径转换之间滑动动作。我可以创建幻灯片,但不要将转换之间的效果。
I'm attempting to create a sliding action between route transitions. I can create the effect in a slideshow but not between route transitions.
反正code如下:
导航
Anyway code below:Nav
<li><a ng-click="go('/')" class = "intro currentLink navLinks">Intro</a></li>
<li><a ng-click="go('/why')" class = "why navLinks">Why</a></li>
<li><a ng-click="go('/resume')" class = "resume navLinks">Res</a></li>
<li><a ng-click="go('/qualified')" class = "qualified navLinks">How</a></li>
<li><a ng-click="go('/contact')" class = "contact navLinks">Contact me</a></li>
查看(S)
<div class = "pages">
<div ng-view id="slides" ng-animate="'slide'">
<!--inside main view-->
</div><!--end main view-->
</div><!--end pages-->
CSS
.slide-leave-setup {
-webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s;
-moz-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s;
-o-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s;
transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s;
}
.slide-enter-setup {
-webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s;
-moz-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s;
-o-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s;
transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s;
}
.slide-enter-setup {
position: absolute;
left: 1300px;
}
.slide-enter-start {
left: 0;
}
.slide-leave-setup {
position: absolute;
left: -1700px;
}
.slide-leave-start {
right: 0;
}
包括
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular-animate.min.js"></script>
<script src="http://code.angularjs.org/1.2.3/angular-route.min.js"></script>
<script src="http://code.angularjs.org/1.1.2/angular-sanitize.js"></script>
<script src="js/vendor/ui-bootstrap-custom-tpls-0.6.0.js"></script>
JavaScript的:
javascript:
var app = angular.module('MyApp', ['ui.bootstrap', 'ngSanitize', 'ngRoute', 'ngAnimate']);
在
全项目
感谢您
推荐答案
对于任何googleing这个....
For anyone googleing this....
添加类纳克输入/ NG休假/ .ng进入主动/ .ng休假主动到你的CSS类。
示例
Add the classes ng-enter/ng-leave/.ng-enter-active/.ng-leave-active to your css classes.Example
.slide-animate.ng-enter, .slide-animate.ng-leave{
-webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s;
-moz-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s;
-o-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s;
transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s;
}
.slide-animate.ng-enter.ng-enter-active {
position: absolute;
left: 1300px;
}
.slide-animate.ng-enter {
left: 0;
}
.slide-animate.ng-leave.ng-leave-active {
position: absolute;
left: -1700px;
}
.slide-animate.ng-leave {
right: 0;
}
也对动画一些伟大的视频,如果你深入的教程希望
Egghead.io also has some great video on animation if you want a in depth tutorial
这篇关于路线过渡angularjs之间的滑动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!