Skip to content

Instantly share code, notes, and snippets.

@martisj
Created March 9, 2012 01:11
Show Gist options
  • Save martisj/2004450 to your computer and use it in GitHub Desktop.
Save martisj/2004450 to your computer and use it in GitHub Desktop.
animated gif not replacing background image
var image = new Image();
image.src = "<?php echo base_url('assets/img/layout/upload_form_loading.gif'); ?>";
$('#submit-button').click(function() {
$(this).css('background-image', 'url(' + image + ')');
console.log($(this).css('background-image'));
$(this).unbind('click');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment