DD: CSS in Javascript

Beitrag lesen

Hallo Forum,

ich habe wenig Ahnung, weshalb sich mir eine vielleicht einfach zu beantwortende Frage stellt.

In dem nachstehenden Quelltext geht es um ein Menu. Bei Mouseover erscheint eine zweite Reihe unter dem Hauptmenü. Ich würde jetzt gerne der ersten und der zweiten Reihe ein je verschiedenes CSS- Format zuweisen, aber so, wie es im normalen html funktioniert (Bsp.: class="xxx"), geht es hier nicht. Ansonsten ist der Quelltext eigentlich einfach.

Hat jemand eine Idee/ Tipp?

Vielen Dank & Gruß!
DD

Hier der Quelltext:

<head>
<style>
<!--
<!-- Format für obere Zeile "Test 01" //-->
a.meno:link {color : #000000; text-decoration: none; font-family:"Arial"; font-size:10pt; font-weight:bold }
a.meno:visited {color : #000000; text-decoration: none; font-family:"Arial"; font-size:10pt; font-weight:bold }
a.meno:active {color : #000000; text-decoration: none; font-family:"Arial"; font-size:10pt; font-weight:bold }
a.meno:hover {color: #000000; text-decoration: none; font-family:"Arial"; font-size:10pt; font-weight:bold }

<!-- Format für untere Zeile "Test A"//-->
a.menu:link {color : #9F989F; text-decoration: none; font-family:"Arial"; font-size:10pt; font-weight:bold }
a.menu:visited {color : #9F989F; text-decoration: none; font-family:"Arial"; font-size:10pt; font-weight:bold }
a.menu:active {color : #9F989F; text-decoration: none; font-family:"Arial"; font-size:10pt; font-weight:bold }
a.menu:hover {color: #EFEFEF; text-decoration: none; font-family:"Arial"; font-size:10pt; font-weight:bold }

a:link {color : #9F989F; text-decoration: none; font-family:"Arial"; font-size:10pt; font-weight:bold }
a:visited {color : #9F989F; text-decoration: none; font-family:"Arial"; font-size:10pt; font-weight:bold }
a:active {color : #9F989F; text-decoration: none; font-family:"Arial"; font-size:10pt; font-weight:bold }
a:hover {color: #EFEFEF; text-decoration: none; font-family:"Arial"; font-size:10pt; font-weight:bold }
-->
</style>

</head>

<body bgcolor="#6F7080">
<table border="0" width="790">
  <tr>
    <td width="100%" align="center"><script language="JavaScript">
var link_array = new Array();
link_array = [
["Start","http://www.java24.net","_blank",],
["Test 01","http://www.java24.net","_blank",[["Test A","http://www.java24.net","_blank"],["Test B","http://www.java24.net","blank"]]]
];

var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1;
var ns6=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1;
var ns4=document.layers;

function changes(id)
{
  var txt ="<center>";
  id = id-1
  for(i=0;i<link_array[id][3].length;i++)
  {
    txt += "<a href='"+link_array[id][3][i][1]+"' target='"+link_array[id][3][i][2]+"'>"
    txt += link_array[id][3][i][0];
    txt += "</a>    "
  }
  txt += "</center>"

if(ie4||ns6)
  {
   dsub_obj.innerHTML = txt;
  }
  if(ns4)
  {
   dsub_obj=document.dsub;
   dsub_obj.document.write(txt);
   dsub_obj.document.close();
 }
}

if(ns4) document.write("<layer><center>")
else document.write("<div class=header>")
for(i=0;i<link_array.length;i++)
{
 document.write("<img src='men01.gif'>  ")
 document.write("<a href='"+link_array[i][1]+"' target='"+link_array[i][2]+"' onmouseover=changes("+(i+1)+")>")
 document.write(link_array[i][0]);
 document.write("</a>     ")
}
if(ns4) document.write("</center></layer><br><layer id=dsub name=dsub class=subheader></layer>")
else document.write("</div><div id=dsub name=dsub class=subheader></div>")
var dsub_obj
 if(ns4)
 {
  dsub_obj=document.dsub;
 }
  if(ie4)
 {

dsub_obj=document.all.dsub;
 }
 if(ns6)
 {
  dsub_obj=document.getElementById("dsub");
 }
changes(1);
</script>
    </td>
  </tr>
</table>
</body>