DHTML/CSS Navigationsmenü
dlmusic
- dhtml
Hallo!
Ich habe folgenden Code aus dem Internet, der ein DHTML/CSS basierendes Menü erzeugt. Soweit würde es auch funktionieren, aber ich möchte, dass die Links in den Inlineframe "I1" weitergeleitet werden.
Das Einfügen von Befehlen wie target="I1" halfen nichts und auf die Schnelle habe ich hier auch nicht mehr wie location.href - jedoch ohne Hinweise auf Frameverweise - gefunden.
Der Code:
<style type="text/css">
<!--
.Navlink {COLOR: #FFFFFF; TEXT-DECORATION: none; font-family: verdana; font-size: 8pt; }
a:link.Navlink {color : #FFFFFF;}
a:visited.Navlink {color : #FFFFFF;}
a:active.Navlink {text-decoration: none;}
a:hover.Navlink {text-decoration: none;}
-->
</style>
<script language = "javascript">
<!--
function LmOver(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#FF9900";
elem.style.cursor = 'hand'}
function LmOut(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#FFFFFF";}
function LmDown(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#FF9900";}
function LmUp(path)
{location.href = path;}
//-->
</script>
<table border="0" width="173" bgcolor="#000000" cellspacing="0" cellpadding="0">
<tr><td width="100%">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr><td width="100%" onMouseover="LmOver(this, '#191919')" onMouseout="LmOut(this, '#000000')" onMouseDown="LmDown(this, '#191919')"
onMouseUp="LmUp('home.htm')" bgcolor="#000000" height="25"><A HREF="home.htm" Class="navlink"> News</a></td></tr>
<tr><td width="100%" onMouseover="LmOver(this, '#191919')" onMouseout="LmOut(this, '#000000')" onMouseDown="LmDown(this, '#191919')"
onMouseUp="LmUp('about.htm')" bgcolor="#000000" height="25"><A HREF="about.htm" Class="navlink"> About me</a></td></tr>
<tr><td width="100%" onMouseover="LmOver(this, '#191919')" onMouseout="LmOut(this, '#000000')" onMouseDown="LmDown(this, '#191919')"
onMouseUp="LmUp('projekte.htm')" bgcolor="#000000" height="25"><A HREF="projekte.htm" Class="navlink"> Kompositionen</a></td></tr>
<tr><td width="100%" onMouseover="LmOver(this, '#191919')" onMouseout="LmOut(this, '#000000')" onMouseDown="LmDown(this, '#191919')"
onMouseUp="LmUp('http://41793.netguestbook.com/')" bgcolor="#000000" height="25"><A HREF="http://41793.netguestbook.com/" Class="navlink"> Gästebuch</a></td></tr>
<tr><td width="100%" onMouseover="LmOver(this, '#191919')" onMouseout="LmOut(this, '#000000')" onMouseDown="LmDown(this, '#191919')"
onMouseUp="LmUp('kontakt.htm')" bgcolor="#000000" height="25"><A HREF="kontakt.htm" Class="navlink"> Kontakt</a></td></tr>
<tr><td width="100%" onMouseover="LmOver(this, '#191919')" onMouseout="LmOut(this, '#000000')" onMouseDown="LmDown(this, '#191919')"
onMouseUp="LmUp('links.htm')" bgcolor="#000000" height="25"><A HREF="links.htm" Class="navlink"> Links</a></td></tr>
</table>
</td></tr>
</table>
Ich hoffe, dass mir jemand sagen kann, welchen Befehl ich für mein Vorhaben benötige bzw. was evtl. geändert werden muss. Über Links zu dieser Problembehandlung bin ich natürlich genauso dankbar.
Schonmal vielen Dank!
Hallo dlmusic,
ich weiß nicht wo dein Problem mit targert="" liegt, bei mir klappts. Als Hilfe habe ich dir mal den kompletten Testcode gepostet, der bei mir funktioniert hat.
Ich gehe mal davon aus, dass du nur mit dem IE getestet hast. Dort funktionerte nämlich der dynamische Farbwechsel, aber nicht das Einladen in den I-Frame.
Das einzige, was ich zur Reparatur getan habe, war, dass ich die JavaScript-Funktion LMUP wieder rausgenommen habe sowie den Event-Handler onMouseUp="LmUp('home.htm')".
Jetzt geht's.
Allerdings: Dein Farbwechsel funktioniert nicht im Mozilla, Opera habe ich jetzt nicht getestet.
Viele Grüße
Pidder Lüng
*********
Hier der neue Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="de">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<!--
.Navlink {COLOR: #FFFFFF; TEXT-DECORATION: none; font-family: verdana; font-size: 8pt; }
a:link.Navlink {color : #FFFFFF;}
a:visited.Navlink {color : #FFFFFF;}
a:active.Navlink {text-decoration: none;}
a:hover.Navlink {text-decoration: none;}
-->
</style>
<script language = "javascript">
<!--
function LmOver(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#FF9900";
elem.style.cursor = 'hand'}
function LmOut(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#FFFFFF";}
function LmDown(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#FF9900";}
//-->
</script>
</head>
<body>
<table border="0" width="173" bgcolor="#000000" cellspacing="0" cellpadding="0">
<tr><td width="100%">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr><td width="100%" onMouseover="LmOver(this, '#191919')" onMouseout="LmOut(this, '#000000')" onMouseDown="LmDown(this, '#191919')"
onMouseUp="LmUp('home.htm')" bgcolor="#000000" height="25"><A HREF="http://www.google.de" Class="navlink" target="test"> Google im Frame</a></td></tr>
<tr><td width="100%" onMouseover="LmOver(this, '#191919')" onMouseout="LmOut(this, '#000000')" onMouseDown="LmDown(this, '#191919')"
onMouseUp="LmUp('about.htm')" bgcolor="#000000" height="25"><A HREF="http://www.google.de" Class="navlink"> Google ohne Frame</a></td></tr>
</table>
</td></tr>
</table>
<div>
<iframe src="../../../index.htm" width="90%" height="400" name="test">
<p>Ihr Browser kann leider keine eingebetteten Frames anzeigen:
Sie können die eingebettete Seite über den folgenden Verweis
aufrufen: <a href="../../../index.htm">SELFHTML</a></p>
</iframe>
</div>
</body>
</html>
*****************