brainfck
brainfck

Reputation: 9376

How can I check if a scrollbar is visible or not?

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

Answers (1)

user352741
user352741

Reputation: 96

you can check elem.clientHeight < elem.scrollHeight value but it also depends of css properties

Upvotes: 8

Related Questions