I have a javascript sub-menu that is dynamically generated using PHP/MySQL. I've got it working such that onMouseOver the menu appears, and onMouseOut a timer is set that allows the user to go from the trigger event to the sub-menu without losing the sub-menu.
Now I just have one small issue to resolve - how to keep the sub-menu using an onMouseOver event. I'd like to just refer the user to the javascript menu function I've created which triggers the menu to be visible. But, I'm not entirely sure how to do this in the code I have. Here is the code for the menu that is created - where would it be best to refer to a javascript function. I've tried several different things (putting an onMouseOver in the table, div and even the td tags - but I must be missing something...):
Code: Select all
<?php
include ("connection/db.php");
$pagequery = "SELECT id, contentTitle, contentSection, contentPage, contentSubSection, contentOrder FROM content_tb WHERE contentSection = 'collection' AND contentSubSection = '' AND contentShow='yes'";
$pageresult = mysql_query ($pagequery) OR DIE("No results");
?>
<div id="collection">
<table cellpadding="2" cellspacing="2" border="0" summary="menu">
<?php while ($pagerow = mysql_fetch_array ($pageresult))
{ ?><tr>
<!-- Begin Cell -->
<td nowrap="nowrap" bgcolor="#D9DECB" onmouseover="this.style.background='#435607'; this.style.color='#ffffff';" onmouseout="this.style.background='#D9DECB'; this.style.color=''" style="font-weight: normal; color: ; font-family: Arial,sans-serif;font-size: 12px; cursor: default;"
onclick="window.location.href='content.php?section=<?php echo $pagerowї'contentSection'];?>&subsection=<?php echo $pagerowї'contentPage'];?>&page=<?php echo $pagerowї'contentPage'];?>'" title="<?php echo $pagerowї'contentTitle']?>"><?php echo $pagerowї'contentTitle']?></td>
</td>
</tr><?php } ?>
<!-- End Cell -->
</table>
</div>