A javascript code by me

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

    #1

    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?
  • Razor[Aw]
    FFR Player
    • Feb 2007
    • 4

    #2
    Re: A javascript code by me

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

    Comment

    • g4z33b0
      Banned
      • Mar 2006
      • 2618

      #3
      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...