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? :)
Printable View
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
you're more than welcome
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
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.