Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. <body ng-app="myApp">
  2.  
  3. <div style="position: relative; z-index: 5000">
  4. <a ui-sref="state1">State 1</a>
  5. <a ui-sref="state2">State 2</a>
  6. </div>
  7. <div ui-view></div>
  8.  
  9. <script>
  10.  
  11. var myApp = angular.module("myApp",[ "ui.router", "AppCtrls"]);
  12.  
  13. myApp.config(function ($stateProvider, $urlRouterProvider){
  14. $stateProvider.state("state1", {
  15. url: "#",
  16. 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>',
  17. controller: "Ctrl1"
  18. }).state("state2", {
  19. url: "#",
  20. 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>',
  21. controller: "Ctrl2"
  22. });
  23. });
  24.  
  25. var ctrls = angular.module("AppCtrls", []);
  26.  
  27. ctrls.controller( "Ctrl1", function($scope) {
  28. console.log("Ctrl1 loaded.");
  29. angular.element('#multiscroll').multiscroll({
  30. easing: 'linear',
  31. scrollingSpeed: 500,
  32. });
  33. });
  34.  
  35. ctrls.controller( "Ctrl2", function($scope) {
  36. console.log("Ctrl2 loaded.");
  37. angular.element('#multiscroll').multiscroll({
  38. easing: 'linear',
  39. scrollingSpeed: 500,
  40. });
  41. $.fn.multiscroll({
  42. afterLoad: function (anchor, index) {
  43. setTimeout(function () {
  44. $.fn.multiscroll.moveSectionDown();
  45. }, 1000);
  46. },
  47. afterRender: function () {
  48. setTimeout(function () {
  49. $.fn.multiscroll.moveSectionDown();
  50. }, 1000);
  51. }
  52. });
  53. });
  54.  
  55. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement