Hullo brothers!
I wanted to run a function when image loading completes. My code:-
HTML:-
<div id="s_pc" style="background-image:url(http://www.surfixe.com/img/surfixe_pc.png)"></div>
<button id="btn" style="display:none">This button should only show when image loading completes!</button>
jQuery:-
$('#s_pc').attr('style', 'background-image:url(www.surfixe.com/img/surfixe_pc.png)').load(function() {
alert('Image Loaded');
$('#btn').show();
});
Seems like there is an error in my coding. Any ideas?