...

View Full Version : Resolved Swap background image without refreshing?



YourDirector
03-20-2012, 02:48 PM
Hey everyone,

I'm just trying to figure out if it is possible to swap the pages background image when a button is clicked without refreshing the page? I've looked around and can't really find anything helpful.

Any tips or pointers in the right direction would be much appreciated

Thanks

YD

webdev1958
03-20-2012, 02:53 PM
All you need is an onclick event handler on the button which calls a javascript function which then changes the background image css style for the <body>

There's heaps of examples on the www on how to use javascript to change css styles.

YourDirector
03-20-2012, 03:01 PM
Fantastic, thank you for that. A simple and quick search for javascript CSS change gave me exactly what I needed. Thanks!

webdev1958
03-20-2012, 03:03 PM
glad you sorted it out :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum