Hello
I'm trying to center a new image vertically in a div after changing the src using attr in this way:
$("#image").attr("src",newsrc);
var height = $("#image").height();
var newmargin = (divsize - height)/2;
$("#image").css=("margin-top",newmargin);
it always uses the height of the previous image. is it a timing thing? do i need to bind getting the new height to something to prevent it prematurely grabbing the (previous images) height?
all images are preloaded on the loading of the page...