Topic: Showing Children via Drop Down

Hey,

The website I am working on currently has the following structure.

HOME | NORTH | SOUTH | NEWS | CONTACT

when i click NORTH it changes to

HOME | Economic Review | Our Services | Who We Help | Subscription Rates | News | About Us

When I put my mouse over Economic Review I need a drop down of the children pages for that one page....

How can I do this?

I already use this, but it puts the children in the main TR and adds TD for them... So I was wondering how I can make it on mouseover show a dropdown of the children smile

  <table width="1024" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
<?php
 
function stackup($page, $level, &$astack)
  {
  $ancestor = $page->parent;
  if ($ancestor)
    {
    $astack[$level + 1] = $ancestor;
    stackup($ancestor, $level + 1, $astack);
    }
  }
 
function unstack($current, $max, $stack)
  {
  $here = $stack[$current];
  $next = $stack[$current + 1];
  $childs = $here->children();
  $count = count($childs);
  if ($count > 0)
    {
    foreach ($childs as $child)
      {
      if ($child->breadcrumb == $next->breadcrumb)
        {
        echo '<td height="43" align="center" background="http://www.taxbusters.eu.com/images/nav_back.jpg" class="navbar">'.$child->link()."\n";
        if ($current < $max) {
          unstack($current + 1, $max, $stack);
          echo '</td>'."\n";
          }
        else echo '<td height="43" align="center" background="http://www.taxbusters.eu.com/images/nav_back.jpg" class="navbar">'.$child->link().'</td>'."\n";
        }
      else echo '<td height="43" align="center" background="http://www.taxbusters.eu.com/images/nav_back.jpg" class="navbar">'.$child->link().'</td>'."\n";
      }
    }
  }
 
$astack[0] = $this;
stackup($this, 0, $astack);
$bstack = array_reverse($astack);
$lev = count($bstack) - 1;
if ($lev == 0) echo '<td height="43" align="center" background="http://www.taxbusters.eu.com/images/nav_back.jpg" class="navbar">'.$bstack[0]->link('', '')."\n";
else echo '<td height="43" align="center" background="http://www.taxbusters.eu.com/images/nav_back.jpg" class="navbar">'.$bstack[0]->link()."\n";
unstack(0, $lev, $bstack);
echo '</td>'."\n";
 
?>
        </tr>
      </table>

Last edited by wickedwebsites (2010-04-16 00:59)

Thumbs up

Re: Showing Children via Drop Down

I just found OWEB's version of suckerfish but I keep getting a JS error:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; OfficeLiveConnector.1.4; OfficeLivePatch.1.3; ImageShack Toolbar 4.8.3)
Timestamp: Fri, 16 Apr 2010 01:12:51 UTC


Message: 'document.getElementById(...)' is null or not an object
Line: 70
Char: 3
Code: 0
URI: http://taxbusters.eu.com/wolfcms/?northern-ireland.html

This is the line   var sfEls = document.getElementById("nav-m").getElementsByTagName("LI"); and in the snippet it says <ul id="nav-m"><?php echo snippet_menuh($this->find('/')); ?></ul>

So Im a bit lost sad

Last edited by wickedwebsites (2010-04-16 02:19)

Thumbs up

Re: Showing Children via Drop Down

Hi guys,

Can anyone help me out with this please?

I need a simple way to show drop downs within the menu bar, and I'm getting myself very confused smile

Cheers

Thumbs up