Link to home
Start Free TrialLog in
Avatar of Biker5
Biker5

asked on

swap images in sequence on refresh

I have made a website template with a header image.  I would like the image to change upon refresh/reload. I have a file in which I will keep a series of images to fill the template placeholder: images/swap/image1.jpg, image2.jpg, etc. Here is a webpages. Everything has been uploaded. http://mcleantreesfoundation.org/index1.html 

You will see that I have a javascript file in the template that was supposed to swap the image. It isn't working.

I would be very grateful for a simple solution. I don't know jscript, javascript, or php, but I can follow simple directions. Thank you.
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

In swap.js, change this:
var oldWindowOnload=window.onload;

Open in new window

to this:
var oldWindowOnload=window.onload||function(){};

Open in new window


HTH,
Dan
ASKER CERTIFIED SOLUTION
Avatar of Pierre Cornelius
Pierre Cornelius
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Biker5
Biker5

ASKER

I changed the code as indicated and it all works perfectly!!! Thank you so much.
Glad to help. Good luck.