Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <body ng-app="myApp">
- <div style="position: relative; z-index: 5000">
- <a ui-sref="state1">State 1</a>
- <a ui-sref="state2">State 2</a>
- </div>
- <div ui-view></div>
- <script>
- var myApp = angular.module("myApp",[ "ui.router", "AppCtrls"]);
- myApp.config(function ($stateProvider, $urlRouterProvider){
- $stateProvider.state("state1", {
- url: "#",
- template: '<div class="slider"id="multiscroll"><div class="ms-left"><div class="ms-section"><h1>Frame 1</h1></div><div class="ms-section"><h1>Frame 2</h1></div><div class="ms-section"><h1>Frame 3</h1></div><div class="ms-section"><h1>Frame 4</h1></div></div><div class="ms-right"><div class="ms-section"><h1>Frame 5</h1></div><div class="ms-section"><h1>Frame 6</h1></div><div class="ms-section"><h1>Frame 7</h1></div><div class="ms-section"><h1>Frame 8</h1></div></div></div>',
- controller: "Ctrl1"
- }).state("state2", {
- url: "#",
- template: '<div class="slider"id="multiscroll"><div class="ms-left"><div class="ms-section"><h1>Frame 1</h1></div><div class="ms-section"><h1>Frame 2</h1></div><div class="ms-section"><h1>Frame 3</h1></div><div class="ms-section"><h1>Frame 4</h1></div></div><div class="ms-right"><div class="ms-section"><h1>Frame 5</h1></div><div class="ms-section"><h1>Frame 6</h1></div><div class="ms-section"><h1>Frame 7</h1></div><div class="ms-section"><h1>Frame 8</h1></div></div></div>',
- controller: "Ctrl2"
- });
- });
- var ctrls = angular.module("AppCtrls", []);
- ctrls.controller( "Ctrl1", function($scope) {
- console.log("Ctrl1 loaded.");
- angular.element('#multiscroll').multiscroll({
- easing: 'linear',
- scrollingSpeed: 500,
- });
- });
- ctrls.controller( "Ctrl2", function($scope) {
- console.log("Ctrl2 loaded.");
- angular.element('#multiscroll').multiscroll({
- easing: 'linear',
- scrollingSpeed: 500,
- });
- $.fn.multiscroll({
- afterLoad: function (anchor, index) {
- setTimeout(function () {
- $.fn.multiscroll.moveSectionDown();
- }, 1000);
- },
- afterRender: function () {
- setTimeout(function () {
- $.fn.multiscroll.moveSectionDown();
- }, 1000);
- }
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement