Reputation: 9376
I want to display a "Go to top"-Link on my website. This link should only be visible, if the vertical scrollbar is visible.
How can I do this using JavaScript?
Thanks
Upvotes: 6
Views: 12727
Reputation: 96
you can check elem.clientHeight < elem.scrollHeight
value but it also depends of css properties
Upvotes: 8