If you provide a specific code, we can offer assistance. Without it, it's challenging to determine exactly what you're working on.
Preliminarily, it appears to be related to the usage of window.offset()
in your javascript function.
UPDATE
After examining the JS files in your project, it seems you are working on a WordPress project. Often, themes downloaded for WordPress installations come with a theme.js file. Here is the path to your theme JS file:
I have included the code snippet from the file, which is used to make the navigation bar sticky:
// 6.EM STIKY NAV
var headers1 = $('.trp_nav_area');
$(window).on('scroll', function () {
if ($(window).scrollTop() > 200) {
headers1.addClass('hbg2');
} else {
headers1.removeClass('hbg2');
}
});
Simply locate this file and replace the value $(window).scrollTop() > 200
with your preferred value (such as 0
). Keep in mind that this value is measured in pixels.