javascript - Equalizing Heights of Divs -
:) have little problem:
i have div, , inside it, have 2 divs, 1 next another. 1 of left varies height keep relation width while resizing, , want 1 of right have same height left one; have code in jquery @ end of document:
<script> $("#right").css("height",$("#left").height()); </script>
the left 1 has content (that gives height) takes time load, so, code, when load page 1 of right has 0px of height, think that's because left 1 hasn't loaded content when code runs. so, should make sure i'm running code when left 1 has content loaded? and, how can make code refresh every time left's height changes?
although code doesn't work, created function (called equalize) code, , created button onclick="equalize()", , when press button, right's height gets left's height. .-.
try this:
<script> $(document).ready(function(){ $("#right").css("height",$("#left").height()+"px"); }); </script>
Comments
Post a Comment