Change BG Image, change bg img with three buttons |
Change BG Image, change bg img with three buttons |
hungrychapstick |
Feb 3 2012, 11:36 AM
Post
#1
|
Group: Members Posts: 3 Joined: 3-February 12 Member No.: 16,386 |
Hello! Thank you for your time.
My problem is, I would like to be able to change the background image of my webpage with three different buttons- each changing the background to something different (obviously). I'm not sure if this question belongs here.. (I think it does). This is such a newbie question, I know. I tried a variety of different things with javascript and stylesheets, and a few times I almost had it. I am new to this, so any help would be much appreciated! |
hungrychapstick |
Feb 3 2012, 12:10 PM
Post
#2
|
Group: Members Posts: 3 Joined: 3-February 12 Member No.: 16,386 |
Alright! I figured it out! Thanks for viewing, anyway. Dx
(Is there a way to close this thread??) |
Christian J |
Feb 3 2012, 12:36 PM
Post
#3
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
How did you solve it?
Normally we don't close threads in this forum... |
hungrychapstick |
Feb 3 2012, 12:58 PM
Post
#4
|
Group: Members Posts: 3 Joined: 3-February 12 Member No.: 16,386 |
How did you solve it? Normally we don't close threads in this forum... CODE <html> <head> <title>Jake's Backgrounds</title> </head> <body style="background-image:url(original.jpg)"> <h1>Change the Background!</h1> <form> <input type="button" name="button" value="Clover" onclick="document.body.style.backgroundImage = 'url(clover5.jpg)';" /> <input type="button" name="button" value="Metal" onclick="document.body.style.backgroundImage = 'url(metal4.jpg)';" /> <input type="button" name="button" value="Rainbow" onclick="document.body.style.backgroundImage = 'url(rainbow3.jpg)';" /> </form> </body> </html> It was... actually simple. Dx I was making it VERY difficult. Ugh. And, I see. Well.. I'm sorry this thread will sit here, then! D: |
Lo-Fi Version | Time is now: 25th April 2024 - 09:53 PM |