Skip to Content
avatar image
Former Member

How to get to know the scrollcontainer show/hide it's scroll bar

Hi Experts,

I'm doing a logic with adding items into a scrollcontainer with a "To top" icon. This icon only shows when the content is longer than the scrollcontainer and a vertical scroll bar shows.

My question is how to get to know whether a scroll bar is shown or not?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 24, 2017 at 04:07 AM

    it will show only when the content is longer than the scrollcontainer.!!

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 24, 2017 at 06:22 AM

    Hi Scar,

    There is no such predefined method or function to determine the scroll bar visibility so you need to compare the heights of the inner content and the container content using javascript .. Just check out this https://stackoverflow.com/questions/4814398/how-can-i-check-if-a-scrollbar-is-visible .. might be this helps you ..

    Thanks

    Viplove

    Add comment
    10|10000 characters needed characters exceeded