How do I run code when an image used as background
is loaded?
I tried:
$ ('#IDdaImagem').on('load', function () {
/ / 'Código parágrafo CARREGAR uma page / Conteúdo'
})
and does not work the image continues to load after ...
is a background image , and I use a jQuery plugin to open in other resolutions, the backstretch, it uses a div with backstretch class, as I load this background image with 2mb before the content of the site?
I tested this and it works, but not on the element I'm going to give show, only on alert.
<script>
$('.backstretch img').load(function() {
alert('done loading image');
$("#corpo").show();
});
</script>
This does not work:
<script>
$ ('#IDdaImagem').on('load', function () { // no space
$("#corpo").show();
})
</script>
This works:
<script>
$ ('#IDdaImagem').on('load', function () { // no space
alert ('Test');
})
</script>