I am now in the child window. My javascript is running. I want to know if the window has scrollbars enabled or not. How do I do this?
- I am in IE so window.scrollbars/this.scrollbars won't return anything Ghost of Forums Past fucked around with this message on 02-24-2010 at 08:34 AM.
- The window's scrollbars exist outside the body.
- Looking at the document's width will tell me about the document. I can even figure out if there are scrollbars in the document. This will not tell me anything about the window itself.
- The width of the scrollbar in question changes dependent on what the currently selected Windows Desktop Theme is, for ascetic reasons.
- Again, document.documentElement.clientHeight < document.body.offsetHeight or anything else related to the document will tell me about the document, not the window itself.
Vertical: Have you tried document.body.scrollHeight > document.body.clientHeight?
Horizontial
Have you tried comparing document.width and window.innerWidth?
Both should compare the viewable space with the actual width of the window itself. If the former is bigger than the latter, you have scrollbars most likely.
Looking at document.body will tell me about the document, including whether or not the document controls strollbars.
Unfortunately, even if document.body's overflow style was set to always show scrollbars, it wouldn't affect the window's scrollbars one way or another. In fact, if you did this, you could have scrollbars attached to the document and scrollbars attached to the window.
I can get the width of the body, if it has scrollbars, and the like. Unfortunately, this is not enough information for me to do what I need to do. I need to figure out if the application window has scrollbars so I can properly call window.sizeTo in Internet Explorer.
Calling window.sizeTo resizes the application window, not just the inner body. That means the file open/etc tabs on the top, the scrollbar on the right, the resize bar on the left, and everything else need to be taken into account. You can't know this by looking at the body. Technically, you can't know it at all because every windows theme has a different padding, but I'm assuming everyone is using the default theme for their given Operating System. Ghost of Forums Past fucked around with this message on 02-25-2010 at 10:29 AM.
What you're asking might not exist or its a very complicated bit of code to figure it out. Katrinity fucked around with this message on 02-25-2010 at 03:12 PM.
quote:
ACES! Another post by Katrinity:
Nevermind.What you're asking might not exist or its a very complicated bit of code to figure it out.
So far I asked on Something Awful, Stack Overflow, here, an e-mail to my co-workers, and on the ASP.Net forums.
It's gotten to the point where I may actually sacrifice an MSDN trouble ticket for a solution or conformation that none exists. Ghost of Forums Past fucked around with this message on 02-25-2010 at 03:34 PM.