>> Found a simple solution: >> var maxwidth = document.body.clientWidth; >> >> I have tested this in IE6, and it works in a window or a frame. The >> width is returned in pixels. This is the width of the frame, not the >> writeable area in the document (so it would include space used by >> scrollbars), so if you use it, probably best to deduct a bit from it >> to make artwork fit nicely. > >sadly, only valid for IE from what I've read. > Oh. It works in some other browsers (I think Mozilla copes, and it works in PsPad editors' preview mode), but I haven't tried with FireFox or Netscape. I think you can use innerWidth instead for older browsers.
Following a quick google search, I came across the following: http://forums.devshed.com/archive/t-230449/clientWidth-in-mozillafirefox It says that clientWidth works in IE Win, Opera, Firefox, Mozilla, Mozilla Red Hat, Safari and IE Mac 5.2 OSX and IE Mac 5.1 OX9, (maybe fails with really old netscape browsers). It should be possible to use clientWidth, but if the browser doesn't support the property (returns undefined), use innerWidth or outerWidth, or perhaps otherwise default to 300 px? I saw an example that does: daWidth = (!document.all) ? window.innerWidth : document.body.clientWidth; >yup, that's what I was doing too, but the part I was misisng was that >it MUST be called after the body tag is rendered. >i've checked in a big patch to the skin tonight, so see what you think. > Will this be in "todays" nightly release? It's morning here in the UK :) Phil _______________________________________________ beta mailing list [email protected] http://lists.slimdevices.com/lists/listinfo/beta
