
November 15th, 2005, 01:58 PM
|
|
Registered User
|
|
Join Date: Apr 2007
Posts: 22,309
Time spent in forums: < 1 sec
Reputation Power: 24
|
|
|
navigation Problem
Hi
I am using the bulletlist navigation on my website. I use two $_GET variables for my gallery (site=fotos&fotos=1).
The first one loads the file and the second one loads the path where the images are stored. the file is always the same. The Problem is that the navigation always closes after clicking on a gallery link. What could i do to change that?
Thanks
php Code:
Original
- php Code |
|
|
|
<?php // Javascript Teil echo " function toggle(id) {n"; echo " if(document.getElementById) {n"; echo " var el = document.getElementById(id);n"; echo " el.style.display = (el.style.display == 'none') ? 'block' : 'none';n"; // Menu array $fotos['Main'] = 'index2.php?site=fotos&fotos=1'; $fotos['menu1']['sub1']['pos1'] = 'index2.php?site=fotos&fotos=2'; $fotos['menu1']['sub1']['pos2'] = 'index2.php?site=fotos&fotos=3'; $fotos['menu1']['sub2']['pos1'] = 'index2.php?site=fotos&fotos=4'; $fotos['menu2']['sub1']['pos1'] = 'index2.php?site=fotos&fotos=5'; //Menu function array_search_recursive($needle, $haystack) { $pos = null; while(! $pos && (list($garbage, $value)= each($keys))) { if($haystack[$value] === $needle) $pos[] = $value; if($pos = array_search_recursive($needle, $haystack[$value])) } } return $pos; } function draw_menu($fotos, $preserve, &$id) { if($id == 0) echo "<div id="$id">rn<ul class="menu ">rn"; else echo "<div id="$id" style="display:none; ">rn<ul class="menu ">rn"; $id += 1; foreach($fotos as $key=>$value) { $toggle = $id; echo "<li class="menu "><a class="menu " href="#" onclick="toggle($id);">$key</a></li>rn"; draw_menu($value, $preserve, $id); } else { echo "<li class="menufile ">"; echo "<a class="menulive " href="$value">$key</a>"; else echo "<a class="menu " href="$value">$key</a>"; } } echo "<script language="javascript ">toggle($toggle);</script>rn"; } $id = 0; $self = isset($_SERVER['QUERY_STRING']) ? $base. '?'. $_SERVER['QUERY_STRING'] : $base; $preserve = array_search_recursive($self, $fotos); draw_menu($fotos, $preserve, $id); ?>
|