Jump to content
  • Advertisement
Sign in to follow this  
Jinx3d1

[web] errr! simple question...

This topic is 5050 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!