Skip to content

Instantly share code, notes, and snippets.

@andersonfraga
Created December 6, 2011 17:19
Show Gist options
  • Save andersonfraga/1439021 to your computer and use it in GitHub Desktop.
Save andersonfraga/1439021 to your computer and use it in GitHub Desktop.
Troca uma imagem em background de segundos em segundos
$j(document).ready(function() {
counter_img = 1;
setInterval(function() {
if(++counter_img > 4) {
counter_img = 1;
}
$j('#topo > h1').animate({
opacity: '0.8'
}, function() {
$j(this).css('background-image', 'url(image_' + counter_img + '.png)').animate({
opacity: '1'
});
});
}, 10000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment