Changing background images at specific times

I have a webpage - (which triggers a song on load) - that fades background images in and out at a specified interval. How would I code it so that each image was timed to fade in and out at a specific time and stay for a specific duration? With a final image that fades in and stays on at the end of the song. Here's the page:


John CarneyReliability Business Tools Analyst IIAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Instead of reinventing the wheel, use a plug in like jplayer

You can see the code for the change of images is in the html for the image src, data-slide-time="10"

<div class="audio-slides">
						<img src="" alt="[Dalen, Telemarken (i.e, Telemark), Norway] (LOC)" data-thumbnail="" data-slide-time="0">
						<img src="" alt="[Near Hjelmso, Fuglebjerget, Norway] (LOC)" data-thumbnail="" data-slide-time="10">
						<img src="" alt="[The Seven Sisters, Geiranger Fjord, Norway] (LOC)" data-thumbnail="" data-slide-time="30">
						<img src="" alt="[Praekestolen, Geiranger Fjord, Norway] (LOC)" data-thumbnail="" data-slide-time="45">
						<img src="" alt="[Kongen og Dronningen, Bispen, Norway] (LOC)" data-thumbnail="" data-slide-time="70">
						<img src="" alt="[Merok, Geiranger Fjord, Norway] (LOC)" data-thumbnail="" data-slide-time="90">
						<img src="" alt="[Buerbrae Glacier, Odde, Hardanger Fjord, Norway] (LOC)" data-thumbnail="" data-slide-time="110">
						<img src="" alt="[Folgefond Glacier, Hardanger Fjord, Norway] (LOC)" data-thumbnail="" data-slide-time="130">
						<img src="" alt="[Naerodalen, Hardanger Fjord, Norway] (LOC)" data-thumbnail="" data-slide-time="150">

Open in new window

John CarneyReliability Business Tools Analyst IIAuthor Commented:
Hi Scott, thanks for posting, sorry I've been AWOL for a little bit. I'm definitely in favor of not re-inventing the wheel, but I'm not sure how it will work with the rest of the page. If you haven't already, please take a look at the page and let me know if it can be seamlessly blended with the html and css.

John CarneyReliability Business Tools Analyst IIAuthor Commented:
Hi Scott, so is their a way to adapt the code you posted above seamlessly with my existing code? Perhaps a js file that will make the html code in your comment work? It seems to me if I strip down the lines in your code - no alt (or thumbnail since I don't have one) - a typical line might be as simple as this:  
<img src="" data-slide-time="35">

Open in new window

Is that right? If not what would the code for a typical line look like?  Or does it only work with flickr?

Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!


where are you with that question?
I checked your site and look like you achieve your goal
John CarneyReliability Business Tools Analyst IIAuthor Commented:
Hi leakim97, thanks for asking. I haven't done anything because I can't figure out how to adapt it to my code. Any thoughts on how to do that?

I believe this one is more easy to use :

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I'm sorry for not following up. Sometimes I get too many notifications and one gets lost.

To answer your question though, which ever you use, you will have to adjust what you are doing a little.  But that will be easier than writing your own from scratch.

I have not tried leakim's solution, but would trust that if he said a different option is easier, it probably is.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.