Skip to Content
0

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

Oct 24, 2017 at 03:00 AM

27

avatar image
Former Member

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?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
avatar image
Former Member Oct 24, 2017 at 04:07 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
VIPLOVE KHUSHALANI Oct 24, 2017 at 06:22 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded