File: /var/www/healthnettoday.com/design/js/main.js
// Function to toggle the menu in mobile view
function toggleMenu() {
const menu = document.getElementById('menu');
menu.classList.toggle('active');
}
// Function to add a shadow when the user scrolls
window.addEventListener('scroll', function() {
const navbar = document.querySelector('.navbar');
if (window.scrollY > 50) {
navbar.classList.add('scrolled'); // Adds shadow when scrolling
} else {
navbar.classList.remove('scrolled'); // Removes shadow when at the top
}
});
// main-1-slide
$(document).ready(function(){
$('.main-1-slide').slick({
dots: true,
arrows:true,
infinite: false,
autoplay:true,
cssEase: 'linear',
speed: 500,
slidesToShow: 1,
slidesToScroll: 1,
});
$('.last-slider-parent').slick({
dots: true,
arrows:true,
infinite: false,
autoplay:true,
cssEase: 'linear',
speed: 200,
slidesToShow: 3,
slidesToScroll: 1,
});
});