Thursday, May 23, 2024
 Popular · Latest · Hot · Upcoming
98
rated 0 times [  104] [ 6]  / answers: 1 / hits: 22360  / 13 Years ago, wed, june 22, 2011, 12:00:00

I have image background.jpg as the background. Every 10s, how to load a new background background_n.jpg which stays for 100ms and then back to background.jpg and so on?


More From » jquery

 Answers
8
function change_background( new_image_source ) {

var myimage = $( '#myimage' );

myimage.attr( 'src', new_image_source );

setTimeout( function () {

change_background( 'new image source here' );

}, 10000);

}

[#91568] Tuesday, June 21, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
xochitl

Total Points: 559
Total Questions: 95
Total Answers: 117

Location: Antigua and Barbuda
Member since Sat, Apr 24, 2021
3 Years ago
xochitl questions
;