jquery - Detect the height auto using javascript -


I have a div with a certain height (ex: 500px). This div contains some HTML block elements. What I would like to achieve is using javascript to find out at which height my devices will be, if I set the height of that fixed height automatically.

: 500px; "& Gt; & lt; p & gt; My Paragraphs & lt; / p & gt; & lt; h1 & gt; My Title & lt; / h1 & gt; & lt; / div & gt;

In the second order of words, I want to get the height of the div without considering the white space from the bottom.

Is there any way I can do that?

How can you calculate and add height of children? Something like this:

 < Code> & lt; div id = "# someId" style = "height: 500px;" & gt; & lt; p & gt; my paragraph & lt; / p & gt; & lt; h1 & gt; my title & Lt; / h1 &   

then in jQuery

  var height = $ ('# someId & gt; p'). () + $ ('# SomeId & gt; h1'). Height ();   

Edit: Or if you want to do something normal: / P>

  var height = 0; $ ("#someId"). Child (). (Function () {height = height + $ (this) .hit ();})    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -