forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Piroumian" <kpiroum...@apache.org>
Subject Re: [POLL] Full vs. truncated menus
Date Fri, 07 Feb 2003 12:44:13 GMT
From: "Morrison, John" <John.Morrison@uk.experian.com>
> > From: Jeff Turner [mailto:jefft@apache.org]
> > > >
> > > >[ ] The menu should be limited to files below the current directory
> > > >[ ] The menu should display all files in the site
>
> Initially, limited.  Eventually, mixed :)
>
> > Ideally, the final menu2html.xsl stylesheet should be given
> > the *entire*
> > site menu structure, with a 'you are here' marker attribute,
> > and be left
> > to render whatever subset of the menu makes sense.  If
> > someone implements
> > a snazzy CSS/JS click-to-open menu, then menu2html.xsl would
> > populate the
> > data structure with all the data.
>
> Hows this...
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/xhtml1-strict.dtd">
>
> <html>
> <head>
> <style>
> a {
> text-decoration: none;
> display: block;
> }
>
> div {
> display: none;
> padding-left: 25px;
> }
>   </style>
> <script>
> function expandMenu(folder) {
>
> if(folder.nextSibling.nextSibling.style.display != "block")
>
> folder.nextSibling.nextSibling.style.display = "block";
> else
>
> folder.nextSibling.nextSibling.style.display = "none";
> }

I'd better generate an ID and use it instead of
folder.nextSibling.nextSibling.

function expandMenu(id) {
    obj = getElementById(id);
    if (obj != null) {
        obj.style = obj.style.display == "block" ? "none" : "block";
    }
}

and in HTML:

<a href="#" onclick="javascript:expandMenu('NA1923')">Group A</a>
<div style="display:block;" id="NA1923">

Btw, I've posted a sample of show/hide-able menu somewhere in March-April,
2002. But that time it was concidered a bad idea. I'd try to find it, but
it's faster to implement from scratch ;)

-- Konstantin

> </script>
> </head>
> <body>
> <a href="#" onclick="javascript:expandMenu(this)">Group
> A</a>
> <div style="display: block;">
> <a href="abb">ab</a>
> <a href="acc">ac</a>
> <a href="add">ad</a>
>
> <a href="#"
> onclick="javascript:expandMenu(this)">Group AA</a>
> <div style="display: none;">
> <a href="aab">aab</a>
> <a href="aac">aac</a>
> <a href="aad">aad</a>
> <a href="#"
> onclick="javascript:expandMenu(this)">Group AAA</a>
> <div style="display: none;">
> <a href="aaab">aaab</a>
> <a href="aaac">aaac</a>
> <a href="aaad">aaad</a>
> </div>
> </div>
> </div>
> <a href="#" onclick="javascript:expandMenu(this)">Group
> B</a>
> <div style="display: none;">
> <a href="a">a</a>
> <a href="b">b</a>
> </div>
> <a href="#" onclick="javascript:expandMenu(this)">Group
> C</a>
> <div style="display: none;">
> <a href="c">c</a>
> <a href="d">d</a>
> </div>
> </body>
> </html>
>
> J.
>
>
> =======================================================================
> Information in this email and any attachments are confidential, and may
> not be copied or used by anyone other than the addressee, nor disclosed
> to any third party without our permission.  There is no intention to
> create any legally binding contract or other commitment through the use
> of this email.
>
> Experian Limited (registration number 653331).
> Registered office: Talbot House, Talbot Street, Nottingham NG1 5HF
>
>


Mime
View raw message