Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know if the scrollbars has appeared in browser (jQuery)?

I need to know, whether a vertical scrollbar has appeared or not in browser window. Is it possible using jQuery or any other way?

like image 977
snitko Avatar asked May 26 '10 13:05

snitko


1 Answers

Like this:

if (document.documentElement.scrollHeight === document.documentElement.clientHeight) {
    //There is no vertical scrollbar
}

This doesn't work in IE

like image 134
SLaks Avatar answered Sep 21 '22 03:09

SLaks