Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. $(document).ready(function() {
  2. if (window.location.href.indexOf("#slide-1") > -1) {
  3. $('html, body').animate({
  4. scrollTop: $("#slide-1").offset().top
  5. }, 2000);
  6. } else if (window.location.href.indexOf("#slide-2") > -1) {
  7. $('html, body').animate({
  8. scrollTop: $("#slide-2").offset().top
  9. }, 2000);
  10. } else if (window.location.href.indexOf("#slide-3") > -1) {
  11. $('html, body').animate({
  12. scrollTop: $("#slide-3").offset().top
  13. }, 2000);
  14. } else if (window.location.href.indexOf("#slide-4") > -1) {
  15. $('html, body').animate({
  16. scrollTop: $("#slide-4").offset().top
  17. }, 2000);
  18. } else if (window.location.href.indexOf("#slide-5") > -1) {
  19. $('html, body').animate({
  20. scrollTop: $("#slide-5").offset().top
  21. }, 2000);
  22. } else if (window.location.href.indexOf("#slide-6") > -1) {
  23. $('html, body').animate({
  24. scrollTop: $("#slide-6").offset().top
  25. }, 2000);
  26. } else if (window.location.href.indexOf("#slide-7") > -1) {
  27. $('html, body').animate({
  28. scrollTop: $("#slide-7").offset().top
  29. }, 2000);
  30. } else if (window.location.href.indexOf("#slide-8") > -1) {
  31. $('html, body').animate({
  32. scrollTop: $("#slide-8").offset().top
  33. }, 2000);
  34. } else if (window.location.href.indexOf("#slide-9") > -1) {
  35. $('html, body').animate({
  36. scrollTop: $("#slide-9").offset().top
  37. }, 2000);
  38. } else if (window.location.href.indexOf("#slide-12") > -1) {
  39. $('html, body').animate({
  40. scrollTop: $("#slide-12").offset().top
  41. }, 2000);
  42. }
  43. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement