A javascript code by me

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • #1
    FFR Player
    MRTL_mrclean17
    • Nov 2006
    • 156

    A javascript code by me

    Code:
    <table>
    <td width=50></td>
    <script language="JavaScript">
    <!--
    // BGCOLOR CHANGER BY JOSHUA HAMILTON
    // JAVASCRIPT AND HTML BY JOSHUA HAMILTON 2007
    // DO NOT REMOVE THIS NOTICE!
    var backColor = new Array(); // 
    backColor[0] = '#00ff00';
    backColor[1] = '#0000ff';
    backColor[2] = '#000000';
    backColor[3] = '#ff0000';
    function changeBG(whichColor){
    document.bgColor = backColor[whichColor];
    }
    //-->
    </script>
    <td width=20%>
    <td width=20%><a href="javascript:changeBG(2)">black</a>
    <td width=20%><a href="javascript:changeBG(1)">blue</a>
    <td width=20%><a href="javascript:changeBG(3)">red</a>
    <td width=20%><a href="javascript:changeBG(0)">green</a>
    </tr></table>
    This code changes the background color for websites, however this requires that you have no background image, would it be possible for me to modify this to change the BG picture?
  • #2
    FFR Player
    Razor[Aw]
    • Feb 2007
    • 4

    Re: A javascript code by me

    yes, document.body.style.backgroundImage = "url('imagelink')";

    Comment

    • #3
      Banned
      g4z33b0
      • Mar 2006
      • 2618

      Re: A javascript code by me

      Who the hell would want to change the color of the background? It would throw off your whole layout. Scrub.

      Comment

      Working...