View Full Version : How do I create a button to change the bg image?
MePerson2k
07-21-2003, 06:15 AM
I have 4 background images, and I want to create buttons or radio boxes to let viewers change the background (and the font colors, too, if possible). I've tried with JavaScript, but I'm not sure exactly what to do. Could someone help, please?
zoobie
07-21-2003, 08:13 PM
I think someone mentioned there was a script @ dynamicdrive.com for this code bloater...Yiiiiiiiiiiikes :D
oracleguy
07-21-2003, 08:16 PM
Couldn't you also just change the style sheet the page uses when you click the button?
Not sure if you can do it client side though. To do it server side would be incredibly easy though.
jalarie
07-23-2003, 07:18 PM
Use JavaScript within the "head" to check for a query string specifying the background. Have a default just in case it's not specified. Write the "body" tag using that background. When the user clicks a button to change the background, run a function to link back to the same page with the new query string for the new background.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.