Suppose you are visiting a page and you scrolled to a portion of that page, now if you refresh or reload the page, you need to check you are not at the top of the website
and add a class to a HTML Elements. So This jQuery code will help you achieve this.
<script>
jQuery(document).ready(function(){
var windowpos = jQuery(window).scrollTop();
console.log(windowpos);
if(windowpos>100){
jQuery('CLASS OR ID OF HTML ELEMENTS').addClass('CLASS YOU WANT TO ADD');
}
});
</script>