Hi,
I have a menu which via the use of Javascript and css, expands and collapses and displays the menu options as you would expect. My menu is a separate php page and I include it in all of my other web pages.
The problem I am having is that when I expand the menu and choose an option, the page is posted/refreshed and the menu collapses again. I need the menu to stay open as you would expect to see being a user.
Here is my PHP menu code:
// get the top level navigation options from the database
$topsqlquery = "SELECT my top level Menu Items";
$topresult = mysql_query($topsqlquery);
while ($datarow = mysql_fetch_array($topresult)) {
$eventid = $datarow['eventid'];
$navtitle = $datarow['navtitle'];
// this bit displays the top level links and when you click the link, it uses javascript to display the
// DIV below in either BLOCK or NONE css style
echo " <div id=\"eventgroup$eventid\" class=\"toplevelnav\">
<a title=\"Click to view events\" href=\"javascript: tccShowEvents($eventid);\">$navtitle</a>
</div>";
// by default, this DIV is hidden and the above javascript displays it appropriatley
echo " <div id=\"eventlist$eventid\" class=\"eventitem\">";
$subsqlquery = "SELECT my sub level menu items WHERE they link to the Top Level Menu Items";
$subdataresult = mysql_query($subsqlquery);
$subcount = mysql_num_rows($subdataresult);
while ($evdatarow = mysql_fetch_array($subdataresult)) {
$sid = $evdatarow['sid'];
$subtitle = $evdatarow['subtitle'];
$suburl = $evdatarow['suburl'];
echo " <div id=\"singleevent$sid\" class=\"evdesc\"><a href=\"eventdetails.php?nid=$eventid&sid=$sid\">$subtitle</a></div>\n";
}
mysql_free_result($subdataresult);
echo "<a title=\"Click to close list\" href=\"javascript: tccHideEventDetails($eventid);\"><p style=\"color:#003366\">close menu</p></a>";
echo "</div>";
}
mysql_free_result($topresult);
Any advice would be greatly appreciated.
Thanks.