Match dimensions of two boxes
by Matthew Day
HTML
<div id="firstbox" class="abox"></div>
<div id="secondbox" class="abox">Shape Made by Jquery</div>
CSS
.abox {
/* float: left; */
}
#firstbox {
border: 1px solid black;
height: 200px;
width: 125px;
}
#secondbox {
border: 1px solid blue;
height: 0;
width: 0;
}
JavaScript
// get a box to match the size of the other
$(function() {
var p = $('#firstbox');
$("#secondbox").css({
'width': p.width(),
'height': p.height()
});
});