How can I add two CSS heights of different divs and make that the height to another div with jquery
Posted
by
NW Tech
on Stack Overflow
See other posts from Stack Overflow
or by NW Tech
Published on 2013-10-22T21:35:56Z
Indexed on
2013/10/22
21:54 UTC
Read the original article
Hit count: 172
jQuery
I have three divs, 1 floated left and the other two floated right (they're stacked).
I'm trying to combine the height of the two on the right and apply that height to the one on the left.
This is what I have, with no luck
$(window).bind("load", function() {
var slw = $('div.2').height();
var lw = $('div.3').height();
var result = slw += lw;
$('div.1').css({
'height': result + 'px'
});
});
TIA
© Stack Overflow or respective owner