custom.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. // responsive navbar for mobile menu
  2. const resBtn = document.getElementById("res-btn");
  3. const bodyTag = document.querySelector("body");
  4. resBtn.addEventListener('click', () => {
  5. bodyTag.classList.toggle("show-mobile-menu");
  6. })
  7. // responsive navbar for mobile menu end
  8. // course short description slider
  9. var swiper = new Swiper(".courses-short-desc", {
  10. spaceBetween: 30,
  11. loop: true,
  12. spaceBetween: 10,
  13. autoHeight: true,
  14. allowTouchMove: true,
  15. slidesPerView: 1,
  16. breakpoints: {
  17. 640: {
  18. slidesPerView: 2,
  19. spaceBetween: 10,
  20. },
  21. 768: {
  22. slidesPerView: 3,
  23. spaceBetween: 20,
  24. },
  25. 1024: {
  26. slidesPerView: 4,
  27. spaceBetween: 30,
  28. },
  29. },
  30. autoplay: {
  31. delay: 2500,
  32. disableOnInteraction: false,
  33. },
  34. });
  35. // why slider
  36. var swiper = new Swiper(".why-slider-1", {
  37. slidesPerView: "auto",
  38. centeredSlides: true,
  39. direction: "vertical",
  40. loop: true,
  41. speed: 5000,
  42. autoplay: {
  43. delay: 0,
  44. pauseOnMouseEnter: true,
  45. reverseDirection: true
  46. },
  47. spaceBetween: 20,
  48. });
  49. // new course slider
  50. var swiper = new Swiper(".new-course-slider", {
  51. spaceBetween: 30,
  52. loop: true,
  53. spaceBetween: 10,
  54. autoHeight: true,
  55. allowTouchMove: true,
  56. slidesPerView: 1,
  57. autoplay: {
  58. delay: 0,
  59. pauseOnMouseEnter: false,
  60. },
  61. breakpoints: {
  62. 640: {
  63. slidesPerView: 2,
  64. spaceBetween: 10,
  65. },
  66. 768: {
  67. slidesPerView: 3,
  68. spaceBetween: 20,
  69. },
  70. 1024: {
  71. slidesPerView: 4,
  72. spaceBetween: 30,
  73. },
  74. },
  75. });
  76. // memory slider
  77. var swiper = new Swiper(".memory-slider", {
  78. slidesPerView: 1,
  79. spaceBetween: 80,
  80. loop: true,
  81. navigation: {
  82. nextEl: ".memory-slider-next",
  83. prevEl: ".memory-slider-prev",
  84. },
  85. });