top
User Name
Pass Word:

home
archives
features
links
users
faqs
registration!
Blatherings

Pop Quiz, Hot Shot
Previous | Next by elfie 25 August, 2006 - 9:28 AM

In Javascript, how do I get the current width of the page in a way that will work in both IE and FF? document.width works in FF, but not in IE.



For bonus points, how do I get the width of a div while it's hidden? obj.offsetWidth only works when the div is visible. Note that I have set a specific width for the div in the stylesheet.




8/26/2006 >> ben

i've been using an element measurement reference lately, to help with the "add a link" thing... as far as i know, you can't use JS to measure a div if it's not visible. you can just set the measurements... but talk to Mike about that?


8/26/2006 >> elfie

awesome. that'll be a HUGE help.

also, reply to my email about best practices :)


8/30/2006 >> ben

i think so...



nice try though!


8/30/2006 >> muhgcee

Ben, I lof the delete button.




You must be logged in to comment.

comments

links

www.flickr.com
This is a Flickr badge showing public photos from Kheiligh. Make your own badge here.

flickr