I am trying get this background to fade in on click. I found one tutorial that was helpful, and I ended up created the code so it has two images, and they fade in and out on click to bring up the picture.
Here’s the work: http://www.mccraymusic.com/bgchangetest.html
Only a couple of issues though:
-
How do I make this work without the images getting selected at random? I’d like it to just switch from the plain black image to the image with the drum set. (And cross-fade to if possible, but not necessary)
-
How do I center the image on the page, so the image of the drums are centered?
I’m guessing this is what you’re after:
DEMONSTRATION
Also added :
to your
#bgelement to center the image.