How to make sticky header be more smoother

Hi, using studio theme website: doorstepdrip.com

I’ve set my header to be sticky but when I scroll it isn’t as smooth as I’d like it to be. What code would I need to make it so that it sticks from the top of the header once is goes past the announcement bar. Rather than sticking once the page has scrolled past the header and then sticking if that makes sense, thanks

I’ve attached a video of how the sticky header looks currently

  1. Find the sticky header code: Within the JavaScript file, search for the code that handles the sticky header functionality. It might look similar to this:
$(window).scroll(function() {
  if ($(window).scrollTop() > 100) {
    $('.site-header').addClass('sticky');
  } else {
    $('.site-header').removeClass('sticky');
  }
});