I am new to jquery and am currently trying to set a variable equal to the height of some div with id="thing"
before animating another div with class=".init_leftbar"
by the same quantity.
var iHeight = $("#thing").height();
$(".init_leftbar").animate({top: iHeight + "px"});
However, this does not seem to be working.
if I just set "iHeight"
equal to some number it will animate however.
I figured there has been some misunderstanding on my part as to how the "height()"
method works.
Any help is greatly appreciated.
$(document).ready()
with$(window).load()
but to no avail. @guest271314: As in, it just isn't animating.init_leftbar
by shifting it down byiHeight
pixels. if I replace the first line withvar iHeight = 100;
however, this will animate by 100px...