Jump to content

Clear background image button?


ev5unleash

Recommended Posts

This isn't the same as my other thread. On my other thread, I have a button change background images of tables. For this one, I want to have a button clear the background image of the page. I tried tweaking around with

 

<li><a href="#" onClick="document.style.backgroundImage=url''">Remove logo</a></li>

 

but it doesn't work.

this is exactly like your other thread.  You want to change the value of something.

 

look at your other thread.  the backgroundImage value was wrapped in quotes. even the url part.

 

blahblah.backgroundImage='url(...)'

 

does it not stand to reason that you need to do the same thing here? As in, since url is part of the string, you would do this:

 

blahblah.backgroundImage=''

 

this isn't coding.  this is common sense.

I've tried

<li><a href="#" onClick="document.style.backgroundImage=url('...')">Remove logo</a></li>

and

<li><a href="#" onClick="document.style.backgroundImage=url('systemfiles/images/blank.png')">Remove logo</a></li>

. Still does not work on page. Could you fix the code so that it does change the background image to my "blank.png"

what part of "url must be inside the quotes" do you not understand? Again, it's the exact same thing as your other thread.

 

stuffhere.backgroundImage='url(path/to/file)'

 

seriously man, I'm not trying to be mean for the hell of it, but you aren't even trying.  Or if you are, then maybe you should find something else to do, because I've already told you several times what you need to do, as well as you already have a working example in your other thread.  If you cannot use basic common sense and follow simple directions, then pick another hobby, this isn't for you.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.