//If page is scrolled show return to top arrow

jQuery(window).scroll(function() {
    if (jQuery(this).scrollTop() >= 50) {        // If page is scrolled more than 50px
      jQuery('#return-to-top').fadeIn(200);    // Fade in the arrow
    } else {
      jQuery('#return-to-top').fadeOut(200);   // Else fade out the arrow
    }
  });
  jQuery('#return-to-top').click(function() {      // When arrow is clicked
    jQuery('body,html').animate({
      scrollTop : 0                       // Scroll to top of body
    }, 300);
  });
  
  //If page is scrolled show return to top arrow end

  jQuery(function($){
    $(window).on('scroll', function(){
        if ($(window).width() >= 1024) {  // Check if the window width is at least 768px
            var scrollTop = $(window).scrollTop();
            if(scrollTop > 100){
                $('.ekit-template-content-header').addClass('sticky-header');
            } else {
                $('.ekit-template-content-header').removeClass('sticky-header');
            }
        } else {
            // Remove the sticky-header class if the window width is less than 768px
            $('.ekit-template-content-header').removeClass('sticky-header');
        }
    });
});

jQuery(function($){
  $(window).on('scroll', function(){
      if ($(window).width() <= 1023) {  // Check if the window width is at least 768px
          var scrollTop = $(window).scrollTop();
          if(scrollTop > 100){
              $('.ekit-template-content-header .middle-header-sec').addClass('sticky-header');
          } else {
              $('.ekit-template-content-header .middle-header-sec').removeClass('sticky-header');
          }
      } else {
          // Remove the sticky-header class if the window width is less than 768px
          $('.ekit-template-content-header .middle-header-sec').removeClass('sticky-header');
      }
  });
});


  