Seeking advice for modifying arrow function:
<script>
$(window).scroll(function() {
var pxFromBottom = 1300;
if ($(window).scrollTop() + $(window).height() > $(document).height() - pxFromBottom) {
$('#nagore').fadeIn('slow');
} else {
$('#nagore').fadeOut('slow')
}
});
</script>
I am attempting to switch the distance calculation from bottom to top.
So, instead of
pxFromBottom = 1300
I want it to be
pxFromTop = 1300
However, after making this change, the functionality is not working as expected. Any suggestions on how to achieve this?