How do I detect if there are scrollbars on a browser window?
问题 I need to be able to detect whether there are scrollbars (both vertical and horizontal) on a browser window. I've been using this code but it isn't working reliably in Firefox 5. JFL.GetScrollbarState = function () { var myWidth = 0; var myHeight = 0; if (document.documentElement && document.documentElement.clientWidth) { myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else { myWidth = document.body.clientWidth; myHeight = document.body