Hendrik - Quellcode: Javascript und div-Layer

Beitrag lesen

<script type="text/javascript">
 <!--
 var b = new Array();
 b[0] = new Image(); b[0].src = "comic.jpg";

function ch_color(link)
 {
  if(link==1){document.getElementById('unten_re').style.backgroundColor = "#c10b0b";
     document.getElementById('main1').src =  b[0].src;}

if(link==2){document.getElementById('unten_re').style.backgroundColor = "#0c5d87";}

if(link==3){document.getElementById('unten_re').style.backgroundColor = "#1a8412";}

if(link==4){document.getElementById('unten_re').style.backgroundColor = "white";}

if(link==5){document.getElementById('unten_re').style.backgroundColor = "#c7117c";}
 }

//-->
 </script>
 <link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body bgcolor="#FFFFFF" background="scan.png">

<div id="rahmen">
<div id="oben"></div>
<div id="oben-re"></div>
<div id="main" ><img width="700" height="400" src="" id="main1"></div>
<div id="menu"  > <a href="" onClick="ch_color(1)">Home</a><br />
       <a href="" onClick="ch_color(2)">About Me</a><br />
       <a href="" onClick="ch_color(3)">Hobbys</a><br />
       <a href="" onClick="ch_color(4)">Guestbook</a><br />
       <a href="" onClick="ch_color(5)">Contact</a> </div>
<div id="unten" ></div>
<div id="unten_re"></div>
</div>
</body>
</html>