Sign in to follow this  

[web] errr! simple question...

This topic is 4687 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I feel like a dumb ass but I can not figure this out. What I want to do on my site is alow visitors to hit a button or whatever and have the background in the main table change (well, toggle it from textured to colored). I have re written the same function 20x (from really complex to the following) but I just can't get it. basically the function would be very simple... function toggle_bg(onoff) { if(onoff == 0) { document.all.news.background = "cells.GIF"; } else { document.all.news.background = "??"; } Basically, I think that the string document.all.news.background = ... is wrong and then I don't know how to actually disable the background. Blah. call me a dumb a$$ but I can not find the info I need =( thanks a ton for any help.

Share this post


Link to post
Share on other sites
function toggle_bg(onoff)
{
news_item = document.getElementById('news');

if (!news)
return;

if(onoff == 0)
{
news_item.style.backgroundImage = url(cells.GIF) //or url("cells.GIF") ?
}

else
{
news_item.style.backgroundImage = none;
}
}

Share this post


Link to post
Share on other sites

This topic is 4687 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this