Simrey
10-09-2002, 12:09 AM
Does anybody know of a simple way (or failing that, I'll settle for a complicated way) to discover the dimensions of the browser window without opening a new one or resizingTo()? NS4 thoughtfully provides a useful range of tools such as window.innerHeight, but -- astonishingly -- IE appears almost deliberately to ignore it -- as, apparently, does NS6 though I've no experience with that yet. I find that document.body.offsetHeight does the trick -- on my Mac and on some PCs, but not on my office PC, where (logically) it just returns the southern limit of the actual content, which is all of 50 pixels. I'm doing a routine of images floating about, bouncing off each other and off the sides of the window. At the moment I have to resizeTo which is ok but not really elegant, and not guaranteed to have them bouncing precisely off the right and bottom edges, especially if the user subsequently resizes the window...