I create a div dynamically and then should change css properties based on the width of that div:
function test(divID){
//some actions - creating the div 'tbl' structure
$('#'+divID).html(tbl);
var tw = $('#'+divID).width() + 80;
$('.page').css("width", tw+"px");
}
It all works fine in Chrome, but not very stable in FF - sometimes it calculates var tw before the div is rendered and returns its zero width.
How can I sync these events, i.e. measure the width of that div after it has been rendered? I cannot use onLoad, because the whole DOM is loaded before that.
Thanks