Change Main Background Image
# April 25, 2009 at 5:10 am
Niplo.# April 25, 2009 at 6:49 pm
Then you could use a "onclick" attribute to run the code. Simple example:Code:
Note: that you will need to replace randomID with the ID of the item you will be replacing. You may need to give an ID to <body> if that is where you background is applied to.
-www.WebssitesinaFlash.com# April 25, 2009 at 8:37 pm
Thanks for the help, it put me on the right track! I couldn’t really get your code to work, so I used it as a starting point and wrote this:Code:
and the put this on a button:Code:
This worked, do you have any ideas on how I could get that image to fade in? I’m after a smooth transition.# April 27, 2009 at 8:20 am
You could add almost exactly the same code via jquery then you could use the fade to make it look pretty.
You must be logged in to reply to this topic.