MouseOver Navigation
Verfasst: Di 27. Jan 2004, 16:01
Hallo Aussenwelt,
weiss gar nicht ob ich im richtigen Forumszweig bin - folgendes Problem: Habe eine Zusatznavigation, die bei Auswahl eines Links in der Hauptnavigation erscheint (funktioniert) Diese Navigation wird bei Mouseover andersfarbig hinterlegt (hab ich über ein Array und idcat in einem Modul hingewurschtelt). Nun meine Frage: Setze ich überhaupt richtig im Modul an oder muss ich an einer anderen Stelle ansetzen, da bei Click auf den Link der geänderte Zellhintergrund erhalten bleiben soll!
Vielen Dank im Voraus
macsaver
Code der Ausgabe des Moduls:
<?php
include_once($cfg["path"]["contenido"].$cfg["path"]["includes"]."functions.con.php");
$catStart = "CMS_VALUE[0]";
if ($catStart != "") {
$catIds = conDeeperCategoriesArray($catStart);
echo '<table cellpadding="0" cellspacing="0" border="0">';
// echo '<tr><img src="images/spacer.gif" width="10" height="10"></tr>';
/* Create Frame Color Array */
$color = array(1 => "'#DEC185'", 2 => "'#A9C8E7'", 3 => "'#C49F78'", 4 => "'#9BA2BC'", 5 => "'#B48782'", 6 => "'#DEC185'", 7 => "'#A9C8E7'", 8 => "'#C49F78'", 9 => "'#9BA2BC'", 10 => "'#B48782'");
$bg_color = "bgColor='#516476'";
/* Create IDcat Color Array
foreach($catIds as $key=>$val) {
$cell_color=
}
*/
if ( is_array($catIds) ) {
foreach($catIds as $key=>$val) {
// Ersten Eintrag ueberspringen, weil das der Menupunkt selbst ist
// und nicht angezeigt werden soll.
if ($key != 0) {
$sql = "SELECT CAT.idcat AS idcat, name FROM ".
$cfg["tab"]["cat"]." AS CAT, ".
$cfg["tab"]["cat_lang"]." AS CATLANG
WHERE CAT.idcat = ".$val."
AND CAT.idcat = CATLANG.idcat
AND CATLANG.idlang = '$lang'";
$db->query($sql);
$cell_color = $color[$key];
while ( $db->next_record() ) {
echo '<td class="hilfsnavi" height="30" style="padding-left:20px;" onMouseOver="bgColor='.$cell_color.'" onMouseOut='.$bg_color.'>
<a href="front_content.php?idcat='.$db->f("idcat").'">'.$db->f("name").'</a>
<tr><td height="1" style="padding-left:0px; padding-right:0px;"><img src="images/linie_waag_206.gif" width="206" height="1"></td></tr></td>';
} // end while
} // if
} // end foreach
} // end if (is_array)
echo '</table>';
}
?>[/b]
weiss gar nicht ob ich im richtigen Forumszweig bin - folgendes Problem: Habe eine Zusatznavigation, die bei Auswahl eines Links in der Hauptnavigation erscheint (funktioniert) Diese Navigation wird bei Mouseover andersfarbig hinterlegt (hab ich über ein Array und idcat in einem Modul hingewurschtelt). Nun meine Frage: Setze ich überhaupt richtig im Modul an oder muss ich an einer anderen Stelle ansetzen, da bei Click auf den Link der geänderte Zellhintergrund erhalten bleiben soll!
Vielen Dank im Voraus
macsaver
Code der Ausgabe des Moduls:
<?php
include_once($cfg["path"]["contenido"].$cfg["path"]["includes"]."functions.con.php");
$catStart = "CMS_VALUE[0]";
if ($catStart != "") {
$catIds = conDeeperCategoriesArray($catStart);
echo '<table cellpadding="0" cellspacing="0" border="0">';
// echo '<tr><img src="images/spacer.gif" width="10" height="10"></tr>';
/* Create Frame Color Array */
$color = array(1 => "'#DEC185'", 2 => "'#A9C8E7'", 3 => "'#C49F78'", 4 => "'#9BA2BC'", 5 => "'#B48782'", 6 => "'#DEC185'", 7 => "'#A9C8E7'", 8 => "'#C49F78'", 9 => "'#9BA2BC'", 10 => "'#B48782'");
$bg_color = "bgColor='#516476'";
/* Create IDcat Color Array
foreach($catIds as $key=>$val) {
$cell_color=
}
*/
if ( is_array($catIds) ) {
foreach($catIds as $key=>$val) {
// Ersten Eintrag ueberspringen, weil das der Menupunkt selbst ist
// und nicht angezeigt werden soll.
if ($key != 0) {
$sql = "SELECT CAT.idcat AS idcat, name FROM ".
$cfg["tab"]["cat"]." AS CAT, ".
$cfg["tab"]["cat_lang"]." AS CATLANG
WHERE CAT.idcat = ".$val."
AND CAT.idcat = CATLANG.idcat
AND CATLANG.idlang = '$lang'";
$db->query($sql);
$cell_color = $color[$key];
while ( $db->next_record() ) {
echo '<td class="hilfsnavi" height="30" style="padding-left:20px;" onMouseOver="bgColor='.$cell_color.'" onMouseOut='.$bg_color.'>
<a href="front_content.php?idcat='.$db->f("idcat").'">'.$db->f("name").'</a>
<tr><td height="1" style="padding-left:0px; padding-right:0px;"><img src="images/linie_waag_206.gif" width="206" height="1"></td></tr></td>';
} // end while
} // if
} // end foreach
} // end if (is_array)
echo '</table>';
}
?>[/b]