I have this:
function startLoad(object_id) {
$j('div#'+object_id).addClass('currently-loading');
var con = $j('div#overlay');
var img = $j('div#loadimg');
var tab = $j('table.app');
con.height(tab.height() - 30);
con.width(tab.width());
con.css('display', 'block');
img.css('margin-left', (con.width() / 2 - 36) + 'px');
img.css('margin-top', (con.height() / 2 - 36) + 'px');
//alert( (con.width() / 2 - 36)+" "+(con.height() / 2 - 36))
}
and when i uncomment the alert, it shows the correct dimensions... I have tried left, margin-left, both with and without the px. (some for top)
what am I doing wrong?
everything works, except img is in the top left corner of the div that contains it.