Background Switcher #1

This is the first version of a background changer that I came up with. I wanted to let users be able to preview backgrounds on my site. This is how this works:

To create your own, you will need to add this code to your CSS stylesheet:

Then, you will need to add this bit of JavaScript to the head of your document:

Finally, you use this HTML code to add the effect to your page:

Some extra information:

  • The HTML onclick=”bgChange#()” correlates with the JavaScript code that calls upon the background
  • You must change the value of bgChange# to match with one in the JavaScript