Sorry haven't tried reproducing your bug but unless you must use elem.hide() and elem.show().
Alternatively, You can work with addClass and removeClass functions
$('#loading').addClass('hide');
$('#loading').removeClass('hide');
with .hide { display: none; }
works perfectly on safari too.