Hello there,
I have no idea how to do this.
My markup:
<table>
<tr>
<td id="colLeft">
Lorem ipsum dolor<br/>
Lorem ipsum dolor<br/>
Lorem ipsum dolor<br/>
Lorem ipsum dolor<br/>
Lorem ipsum dolor<br/>
Lorem ipsum dolor.
</td>
<td id="colRight">
<div>1</div>
<div>2</div>
</td>
</tr>
</table>
$(document).ready(function() {
$('#colRight > div').each(function() { // I try to: select all divs in #colRight
$(this).height(function(){ // I try to: sets the height of each div to:
$('#colLeft').height() / $('#colRight > div').length(); // the height of #colLeft divided by the number of divs in colRight.
});
});
});
What I am trying to do is to change the height of each div to the height of #colLeft divided by the number of divs in #colRight.
However, it doesnt work.
I've never understood how to chain functions, and never found anyone to teach me.
So I would like to ask two favours of you.
- Why doesnt my above jQuery code.
- Does anyone know of a tutorial that explains it more detailed than in the tutorials on the jQuery website?
Thank you for your time.
Kind regards,
Marius