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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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"

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.