Guest User

Untitled

a guest
Jan 16th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. $('#play-the-series').click(function(){
  2. $('#main-nav #content').animate({
  3. top: '0'
  4. }, 1000, 'jswing');
  5. });
  6.  
  7. $('#play-the-series').click(function(){
  8. // check for a "open" class on the main-nav
  9. if (!$("#main-nav").hasClass('open')) {
  10.  
  11. // your animation
  12. $('#main-nav #content').animate({
  13. top: 0
  14. }, 1000, 'jswing');
  15.  
  16. // container animation
  17. $('#main-nav').animate({
  18. height: 395
  19. }, 1000, 'jswing');
  20.  
  21. // add class to main-nav
  22. $("#main-nav").addClass('open');
  23.  
  24. } else {
  25.  
  26. //reverse everything:
  27.  
  28. $('#main-nav #content').animate({
  29. top: -200
  30. }, 1000, 'jswing');
  31. $(this).addClass('open');
  32.  
  33. $('#main-nav').animate({
  34. height: 195
  35. }, 1000, 'jswing');
  36.  
  37. $("#main-nav").removeClass('open');
  38. }
  39. });
Add Comment
Please, Sign In to add comment