Test if page has a horizontal scrollbar (computer & mobile devices)
问题 On a web page, I need to test if there is a horizontal scrollbar or not (so that I programmatically change the css of some other element). Is there some way to get that information using jquery (or pure javascript)? I tested function isHorizontalScrollbarEnabled() { return $(document).width()!=$(window).width(); } but it does not seem to work with all browsers (does not work for example with a recent Samsung phone I tested). I need it to work with all browsers, including recent mobile devices