How to start a function when background image loads completely?
<p>Hullo brothers!<br><br>
I wanted to run a function when image loading completes. My code:-
<br><br>HTML:-</p>

<pre><code>&lt;div id="s_pc" style="background-image:url(http://www.surfixe.com/img/surfixe_pc.png)"&gt;&lt;/div&gt;
&lt;button id="btn" style="display:none"&gt;This button should only show when image loading completes!&lt;/button&gt;
</code></pre>

<p>jQuery:-</p>

<pre><code>$('#s_pc').attr('style', 'background-image:url(www.surfixe.com/img/surfixe_pc.png)').load(function() {  
    alert('Image Loaded');
    $('#btn').show();
});
</code></pre>

<p><a href="http://jsfiddle.net/Tomer123/rKSKF/3/" rel="nofollow">My current fiddle</a></p>

<p>Seems like there is an error in my coding. Any ideas?</p>
