Sidebar gets stuck at bottom of page

  • Author
    Posts
  • #42241

    I ran into an issue where I had the perfect storm of sidebar height, content height and window height that resulted in the scroll listener not entering if ( mainHeight <= sidebarHeight), if ( sidebarHeight + adminbarOffset > windowHeight), or else if ( ! top ) in frontend.js. This caused the sidebar to be position: fixed on body load, switch to position: absolute when you scroll to the bottom (because it does meet the criteria if ( $sidebar.offset().top + sidebarHeight + adminbarOffset > $footer.offset().top + 40)). After that, it never switches back to fixed because top is still true from the initial declaration.

    To fix this, I added top = false; inside of the if ( $sidebar.offset().top + sidebarHeight + adminbarOffset > $footer.offset().top + 40) statement. This lets if ( ! top ) trigger when scrolling up and sets the sidebar back to fixed. Hope this helps anyone with the same issue, and might be helpful to include in an update if anyone from Cryout reads this.

    Website: zack.reithmeyer.com

    #42497

    Zed
    Cryout Creations Team

    We’ll look into this.


    If you like our creations, help us share by rating them on WordPress.org.
    Please read the available documentation and search the forums before posting.
    #42826

    Harman
    Power User

    [This is a re-post of a reply that I seem to have deleted myself. Sorry about that!]

    I’m experiencing the same issue, but it seems to occur mainly when there are widgets in the Footer area.

    I’m still in the early stages of designing my new test site, and I do want to get this resolved before I make it publicly visible. I really love the look of the Verbosa theme, but this behavior makes the theme unusable. As sidebar widgets do not show in mobile view (yet), I have to use footer widgets. Also, I like the look of having a “bar” across the desktop screen at the bottom of the site, for links like About, Contact etc.

    Coding is not something I’m very comfortable with, so I’m not sure how to apply thunderblaster’s tip on my site. I’m using a child theme (the NoLink child theme provided by Cryout). Where would I place a file to fix this issue, and what would it need to contain?

    There is another issue that I’m experiencing, but I’m not sure if it’s related to this. When I scroll all the way down on desktop, the footer section “pushes up” the sidebar — but not entirely. The bottom bit of the sidebar stay visible “on top of” the footer. Do you have any ideas on how to fix this?

    Thanks a lot!

    #42978

    Zed
    Cryout Creations Team

    @harman, both of the issues will be fixed in the upcoming update.


    If you like our creations, help us share by rating them on WordPress.org.
    Please read the available documentation and search the forums before posting.
    #42984

    Harman
    Power User

    Thank you, Zed!

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Sidebar gets stuck at bottom of page’ is closed to new replies.