Making a menu with Parent Pages/Child Pages
-
ok I am trying to make a rollover menu for my website that will have all of my parent pages, and when the mouse rolls over the parent link in the nav menu the child pages of that parent page will appear under the menu. Here is what I have so far:
<div id=”menu”>
<ul id=”nav <?php echo $page->ID; ?>”>
<?php
foreach (get_pages(‘depth=1’) as $page) {
//if(!$page->post_parent){ ?>
<li <?php echo “class=\”page_item page-item-$page->ID\””; ?>>
post_name.”/”; ?>”
onMouseOver=”Effect.Appear(‘sublist’)” ><?php echo $page->post_title; ?>
<?php }
?></div>
<div id=”submenu”>
<ul id=”sublist<?php echo $parentPage->ID ; ?>” style=”display:none;”><?php
foreach (get_pages(“child_of=$parentPage->ID”) as $childPage) { ?><li <?php echo “class=\”page_item page-item-$childPage->ID\””; ?>
post_name.”/”; ?>”>
<?php echo $childPage->post_title; ?>
<?php } ?>
</div>
How can I achieve a rollOver, I have enabled javascript and used a mouseOver but I still can not get it to work. Any help would be greatly appreciated.
- The topic ‘Making a menu with Parent Pages/Child Pages’ is closed to new replies.