app.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. // sticky navbar
  2. window.addEventListener('scroll', function(){
  3. var header = document.querySelector('.main-nav');
  4. header.classList.toggle("sticky", window.scrollY > 100);
  5. })
  6. // preparation section carousel
  7. var preparation = $('#preparation-carousel');
  8. preparation.owlCarousel({
  9. loop:true,
  10. margin:10,
  11. nav:false,
  12. dots: false,
  13. responsive:{
  14. 0:{
  15. items:1
  16. },
  17. 768:{
  18. items:2
  19. },
  20. 1000:{
  21. items:3
  22. }
  23. }
  24. });
  25. // Go to the next item
  26. $('.preparation-next').click(function() {
  27. preparation.trigger('next.owl.carousel');
  28. })
  29. // Go to the previous item
  30. $('.preparation-prev').click(function() {
  31. preparation.trigger('prev.owl.carousel', [300]);
  32. })
  33. // blog section carousel
  34. var blog = $('#blog-carousel');
  35. blog.owlCarousel({
  36. loop:true,
  37. margin:10,
  38. nav:false,
  39. dots: false,
  40. responsive:{
  41. 0:{
  42. items:1
  43. },
  44. 600:{
  45. items:2
  46. },
  47. 1000:{
  48. items:4
  49. }
  50. }
  51. });
  52. // Go to the next item
  53. $('.owl-next').click(function() {
  54. blog.trigger('next.owl.carousel');
  55. })
  56. // Go to the previous item
  57. $('.owl-prev').click(function() {
  58. blog.trigger('prev.owl.carousel', [300]);
  59. })
  60. // current news section carousel
  61. var currentNews = $('#current-news-carousel');
  62. currentNews.owlCarousel({
  63. loop:true,
  64. margin:10,
  65. nav:false,
  66. dots: false,
  67. responsive:{
  68. 0:{
  69. items:1
  70. },
  71. 600:{
  72. items:2
  73. },
  74. 1000:{
  75. items:4
  76. }
  77. }
  78. });
  79. // Go to the next item
  80. $('.current-next').click(function() {
  81. currentNews.trigger('next.owl.carousel');
  82. })
  83. // Go to the previous item
  84. $('.current-prev').click(function() {
  85. currentNews.trigger('prev.owl.carousel', [300]);
  86. })
  87. // word of the day section carousel
  88. var wordOfDay = $('#wordOfDay-carousel');
  89. wordOfDay.owlCarousel({
  90. loop:true,
  91. items: 1,
  92. margin:10,
  93. nav:false,
  94. dots: false,
  95. });
  96. // Go to the next item
  97. $('.word-next').click(function() {
  98. wordOfDay.trigger('next.owl.carousel');
  99. })
  100. // Go to the previous item
  101. $('.word-prev').click(function() {
  102. wordOfDay.trigger('prev.owl.carousel', [300]);
  103. })