I want to set a background image on the body tag, then run some code - like this:
$(\'body\').css(\'background-image\',\'http://picture.de/image.png\').load(
Something like this:
var $div = $('div'), bg = $div.css('background-image'); if (bg) { var src = bg.replace(/(^url\()|(\)$|[\"\'])/g, ''), $img = $('').attr('src', src).on('load', function() { // do something, maybe: $div.fadeIn(); }); } });