Getting the height and width of content fitting DIV element.

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Aug 2007
Posts: 2
Reputation: possitive is an unknown quantity at this point 
Solved Threads: 0
possitive's Avatar
possitive possitive is offline Offline
Newbie Poster

Re: Getting the height and width of content fitting DIV element.

 
0
  #11
Aug 23rd, 2007
But what if the implicit CSS style value of the div is 'display:none'.. Do you thinkg there is any way to get the size of the div even the CSS style definition is 'display:none'.. ?
lubomir.herko(at)mac.com
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 1
Reputation: raoisrar is an unknown quantity at this point 
Solved Threads: 0
raoisrar raoisrar is offline Offline
Newbie Poster

Re: Getting the height and width of content fitting DIV element.

 
0
  #12
Nov 1st, 2007
hello how are you?
i have same problem to getting div height.
if you have got solution plz tell me thanks
below it is problem.

Originally Posted by alpha_foobar View Post
Hey,
I'm having an issue getting the height and width of DIV elements that have resized themselves to fit their content.

Note: I do not have a problem getting the height and width of DIV elements that I have set using Javascript. The probel is that this value appears to stick. I.e. the height is set to 150px, then the content is changed and the DIV cosumes as much height as is required (clearly more than 150px), however analysing the DOM indicates that the height is the same (though it is clearly not).

I want to know how to get hold of the 'actual' size of a DIV element that is manipulated by the content of the DIV.

I am also interested in a solution that works in IE and Firefox (at least).

Cheers.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,210
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 164
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: Getting the height and width of content fitting DIV element.

 
0
  #13
Nov 2nd, 2007
You can. Just set them to auto in the stylesheet. They are valid styles.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 2
Reputation: rahuls2930 is an unknown quantity at this point 
Solved Threads: 0
rahuls2930 rahuls2930 is offline Offline
Newbie Poster

Re: Getting the height and width of content fitting DIV element.

 
0
  #14
Jun 15th, 2009
Have you tried clientHeight and clientWidth
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC