ev5unleash Posted April 18, 2009 Share Posted April 18, 2009 Hey guys, How do I make a button clear the background image so that it's just the background color? Thanks Quote Link to comment Share on other sites More sharing options...
ev5unleash Posted April 19, 2009 Author Share Posted April 19, 2009 I basically want a button that would clear any background image (if present) Quote Link to comment Share on other sites More sharing options...
.josh Posted April 19, 2009 Share Posted April 19, 2009 same thing as what you did for your other thread, except set it to "" Quote Link to comment Share on other sites More sharing options...
ev5unleash Posted April 19, 2009 Author Share Posted April 19, 2009 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. Quote Link to comment Share on other sites More sharing options...
.josh Posted April 19, 2009 Share Posted April 19, 2009 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. Quote Link to comment Share on other sites More sharing options...
ev5unleash Posted April 19, 2009 Author Share Posted April 19, 2009 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" Quote Link to comment Share on other sites More sharing options...
.josh Posted April 19, 2009 Share Posted April 19, 2009 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. Quote Link to comment Share on other sites More sharing options...
ev5unleash Posted April 19, 2009 Author Share Posted April 19, 2009 Dude, I've tried that exactly how it is except with document, this, and body. And that still doesn't work. Quote Link to comment Share on other sites More sharing options...
ev5unleash Posted April 19, 2009 Author Share Posted April 19, 2009 I finally solved this with <li><a href="#" onClick="document.body.style.backgroundImage = 'url(systemfiles/images/blank.png)';">Remove logo</a></li> . Thanks for the help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.