I've been struggling to resolve an issue with a script that is supposed to scroll down with the page and stop at a specific height. However, right before it reaches the desired point, it temporarily disappears and then reappears.
For reference, here's the code snippet:
$(document).scroll(function () {
var y = $(this).scrollTop();
if (y > 280 && y < 1600) {
$('#model').css("position","fixed");
$('#icons').css("position","fixed");
$('#icons').css("bottom",0);
} else if (y >= 1601) {
$('#model').css("position","absolute");
$('#model').css("top",1600);
$('#icons').css("position","absolute");
$('#icons').css("top",1600);
} else {
$('#model').removeAttr( 'style' );
$('#icons').removeAttr( 'style' );
$('#icons').removeAttr( 'style' );
}
});
Any assistance would be greatly appreciated!