If you know what I mean by the title, I need something where you click a link and it changes the background to a different image?![]()

If you know what I mean by the title, I need something where you click a link and it changes the background to a different image?![]()
yeah.
working example:Code:<script language="JavaScript"> <!-- var backImage = new Array(); // don't change this // Enter the image filenames you wish to use. // Follow the pattern to use more images. The // number in the brackets [] is the number you // will use in the function call to pick each // image. // Note how backImage[3] = "" -- which would // set the page to *no* background image. backImage[0] = "bg1.gif"; backImage[1] = "bg2.gif"; backImage[2] = "bg3.gif"; backImage[3] = ""; // Do not edit below this line. //----------------------------- function changeBGImage(whichImage){ if (document.body){ document.body.background = backImage[whichImage]; } } //--> </script> </textarea> </form> </td> </tr> <a href="javascript:changeBGImage(0)">Change 1</a> <a href="javascript:changeBGImage(1)">Change 2</a> <a href="javascript:changeBGImage(2)">Change 3</a> <a href="javascript:changeBGImage(3)">No Background</a>
www.habbo-club.co.uk/background.htm
Last edited by Swearwolf; 22-08-2007 at 06:35 PM.
no
Thanks a billion and over, you're amazing! :eusa_dancyeah.
working example:Code:<script language="JavaScript"> <!-- var backImage = new Array(); // don't change this // Enter the image filenames you wish to use. // Follow the pattern to use more images. The // number in the brackets [] is the number you // will use in the function call to pick each // image. // Note how backImage[3] = "" -- which would // set the page to *no* background image. backImage[0] = "bg1.gif"; backImage[1] = "bg2.gif"; backImage[2] = "bg3.gif"; backImage[3] = ""; // Do not edit below this line. //----------------------------- function changeBGImage(whichImage){ if (document.body){ document.body.background = backImage[whichImage]; } } //--> </script> </textarea> </form> </td> </tr> <a href="javascript:changeBGImage(0)">Change 1</a> <a href="javascript:changeBGImage(1)">Change 2</a> <a href="javascript:changeBGImage(2)">Change 3</a> <a href="javascript:changeBGImage(3)">No Background</a>
www.habbo-club.co.uk/background.htm
you're more than welcome
no
One last question, can I put the links in an iframe and put the iframe on a page and it changes the page with the iframe on, I tried target="_parent" but it didn't work...
should be able to
ill have a look
*edit*
i cant seem to figure out how you would go about doing this because they are javascript links, they cant open in a new frame correctly...
all i can suggest is if you have a coded layout etc you could create an extra cell near the navigation or w.e you want the links to be and put all the code on same page, all i can think of
Last edited by Swearwolf; 22-08-2007 at 09:42 PM.
no
What about an include? Would that make it open on the main page its changing?
Edit that, I need a scroll bar to be there.
OK, it's like a Habbo Home Script, but you click BackGrounds and a box pops up in a frame and you choose the background you'd like to change it to.
Last edited by Topps; 22-08-2007 at 09:53 PM.
Members who have read this thread: 0Want to hide these adverts? Register an account for free!