How to “if: page can scroll down”

I’ve been trying to create a condition that would only appear if the page can be scrolled down but I can’t find a way to condition if the page is “full” enough that it scrolls down. Not even sure if its possible to do so.

I’m doing this to add a “scroll to top” link on my pages, but only if there is a need to scroll

Read More

If anybody can help me I would appreciate it.

Related posts

Leave a Reply

1 comment

  1. To add a show the ‘scroll to top’ link only if the page has been scrolled using jQuery:

    $(window).scroll(function(){
    
        if($(window).scrollTop() > 25 ){
            $('#scroll_to_top').show();
        }else{
            $('#scroll_to_top').hide();
        }
    
    });