Recently, I've been working on a jQuery project with sticky headers. However, when I tested it on my iPad, I noticed a slight delay and the header jumping around the page.
I'm wondering if this issue can be resolved within the code itself or if it's a more general problem with iOS. I've tried looking for similar problems online, but I haven't found a definitive answer.
var offset = $(".sticky-header").offset();
var sticky = document.getElementById("sticky-header")
var additionalPixels = 50;
$(window).scroll(function () {
if ($(window).scrollTop() > offset.top - additionalPixels) {
$('#profile-container').addClass('fixed');
} else {
$('#profile-container').removeClass('fixed');
}
});
Any help on this issue would be greatly appreciated. Thanks!