Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3. $('.open-overlay').click(function() {
  4. $('.open-overlay').css('pointer-events', 'none');
  5. var overlay_navigation = $('.overlay-navigation'),
  6. top_bar = $('.bar-top'),
  7. middle_bar = $('.bar-middle'),
  8. bottom_bar = $('.bar-bottom');
  9.  
  10. overlay_navigation.toggleClass('overlay-active');
  11. if (overlay_navigation.hasClass('overlay-active')) {
  12.  
  13. top_bar.removeClass('animate-out-top-bar').addClass('animate-top-bar');
  14. middle_bar.removeClass('animate-out-middle-bar').addClass('animate-middle-bar');
  15. bottom_bar.removeClass('animate-out-bottom-bar').addClass('animate-bottom-bar');
  16. overlay_navigation.removeClass('overlay-slide-up').addClass('overlay-slide-down')
  17. overlay_navigation.velocity('transition.slideLeftIn', {
  18. duration: 300,
  19. delay: 0,
  20. begin: function() {
  21. $('nav.Navigation ul li').velocity('transition.perspectiveLeftIn', {
  22. stagger: 150,
  23. delay: 0,
  24. complete: function() {
  25. $('nav.Navigation ul li a').velocity({
  26. opacity: [1, 0],
  27. }, {
  28. delay: 10,
  29. duration: 140
  30. });
  31. $('.open-overlay').css('pointer-events', 'auto');
  32. }
  33. })
  34. }
  35. })
  36.  
  37. } else {
  38. $('.open-overlay').css('pointer-events', 'none');
  39. top_bar.removeClass('animate-top-bar').addClass('animate-out-top-bar');
  40. middle_bar.removeClass('animate-middle-bar').addClass('animate-out-middle-bar');
  41. bottom_bar.removeClass('animate-bottom-bar').addClass('animate-out-bottom-bar');
  42. overlay_navigation.removeClass('overlay-slide-down').addClass('overlay-slide-up')
  43. $('nav.Navigation ul li').velocity('transition.perspectiveRightOut', {
  44. stagger: 150,
  45. delay: 0,
  46. complete: function() {
  47. overlay_navigation.velocity('transition.fadeOut', {
  48. delay: 0,
  49. duration: 300,
  50. complete: function() {
  51. $('nav.Navigation ul li a').velocity({
  52. opacity: [0, 1],
  53. }, {
  54. delay: 0,
  55. duration: 50
  56. });
  57. $('.open-overlay').css('pointer-events', 'auto');
  58. }
  59. });
  60. }
  61. })
  62. }
  63. })
  64. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement