I am making a horizontal navigation page and it works great. But now I need to add animation. I want to add carousel navigation. Therefore, when a visitor clicks the Download button, all content scrolls from right to left, and if the visitor clicks Home, he returns, but with animation from left to right. I would also like it to move between pages when a visitor starts scrolling.
I was looking for some solutions, but did not find anything other than css animation, which ignores the order of the slides and always always performs one shift method. I am new to angular and I would appreciate any help.
Here is my index.html
<!DOCTYPE html> <html lang="es" ng-app="opw"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>Bootstrap 101 Template</title> <link rel="stylesheet" href="css/bootstrap-3.3.5.min.css" /> </head> <body> <nav class="navbar navbar-inverse" role="navigation"> <div class="navbar-header"> <a class="navbar-brand" ui-sref="#">One page website</a> </div> <ul class="nav navbar-nav"> <li><a ui-sref="home">Inicio</a></li> <li><a ui-sref="how_does_it_work">How does it work?</a></li> <li><a ui-sref="wanted">Wanted</a></li> <li><a ui-sref="app">Download app</a></li> </ul> </nav> <div class="container"> <div ui-view></div> </div> <script src="node_modules/angular/angular.min.js"></script> <script src="node_modules/angular-animate/angular-animate.min.js"></script> <script src="node_modules/angular-ui-router/release/angular-ui-router.min.js"></script></script> <script src="js/app.js"></script> </body> </html>
and app.js
angular.module('opw', ['ui.router']) // router configuration .config(function ($stateProvider, $urlRouterProvider) { $stateProvider // HOME STATES AND NESTED VIEWS ======================================== .state('home', { url: '/', templateUrl: 'template/homepage/home.html' }) // HOW-DOES-IT-WORK PAGE AND MULTIPLE NAMED VIEWS ================================= .state('how_does_it_work', { url: '/how-does-it-work', templateUrl: 'template/homepage/hdiw.html' }) // WANTED PAGE AND MULTIPLE NAMED VIEWS ================================= .state('wanted', { url: '/wanted', templateUrl: 'template/homepage/wanted.html' }) // DOWNLOAD-APP PAGE AND MULTIPLE NAMED VIEWS ================================= .state('app', { url: '/download', templateUrl: 'template/homepage/app.html', }); $urlRouterProvider.otherwise('/'); });
Jarod source share