3 Replies - 1383 Views - Last Post: 17 September 2010 - 06:35 AM

#1 raggyshakes   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 12-January 09

Changing background image

Posted 17 December 2009 - 10:32 PM

I want to know how to change the background of my site to an image instead of a color using buttons.
so far i have this code
<input type="button" value="Red" onclick="changeBgColor(this.value);" />
				<input type="button" value="blue" onclick="changeBgColor(this.value);" />
				<input type="button" value="Yellow" onclick="changeBgColor(this.value);" />
				<input type="button" value="Green" onclick="changeBgColor(this.value);" />
				<input type="button" value="Teal" onclick="changeBgColor(this.value);" />
				<input type="button" value="Black" onclick="changeBgColor(this.value);" />
				<input type="button" value="White" onclick="changeBgColor(this.value);" />


instead of changing the color i want to change it to an image, how would i do this?

Is This A Good Question/Topic? 0
  • +

Replies To: Changing background image

#2 chirag.jain18   User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 68
  • Joined: 14-December 09

Re: Changing background image

Posted 17 December 2009 - 11:04 PM

this is javascript question, so better post it there...

to change background image, put a image item on your page(<image src=""/>), and chande src of this image inside your function, and call function on click of button.
Was This Post Helpful? 0
  • +
  • -

#3 Dogstopper   User is offline

  • The Ninjaducky
  • member icon

Reputation: 2965
  • View blog
  • Posts: 11,222
  • Joined: 15-July 08

Re: Changing background image

Posted 16 September 2010 - 04:01 PM

Moved to Javascript.
Was This Post Helpful? 0
  • +
  • -

#4 neit   User is offline

  • D.I.C Head

Reputation: 15
  • View blog
  • Posts: 187
  • Joined: 13-February 09

Re: Changing background image

Posted 17 September 2010 - 06:35 AM

this may help you:
http://programming.t...ge/Default.aspx


You will need to modify for your needs.

This post has been edited by neit: 17 September 2010 - 06:36 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1