Hello Ben,
Finally got around to play with this menu code.
The line to handle the multiple closes needs the current and previous
swapped around....
writeOutput(repeatString("</li>"&chr(13)&"</ul>"&chr(13),previousLevel-curre
ntLevel));
The code works well for producing a fully open tree to the current location.
In fact, I think I may replace the code on the AAM site for the left hand
menu with this code. I was basically managing the level and sibling
handling myself - this is more elegant.
Regards,
Gary Menzel
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Ben
> Bishop
> Sent: Friday, 23 January 2004 9:29 PM
> To: FarCry Developers
> Subject: [farcry-dev] Re: Multi-level menus
>
>
> Good spotting Chris. The code only closes a single level. The fix would
> be to count how many levels need to be closed and write the closing
> </li></ul> for each.
>
> Without FarCry to test on at the moment, the following might do the trick:
>
> if(currentlevel gt previouslevel) { writeOutput("<ul>"&chr(13)); } //
> new menu level
> else if(currentlevel lt previouslevel) {
> writeOutput(repeatString("</li>"&chr(13)&"</ul>"&chr(13),currentLe
> vel-previousLevel));
> } // close menu level
> else { writeOutput("</li>"&chr(13)); }
>
> Let me know if that works,
>
> -Ben
> http://farcry.daemon.com.au/
>
>
> Chris Kent wrote:
>
> > I think that one scenario that this code will not work for is as
> > follows: when closing the UL if the tree structure steps back more
> > than one level you need to close multiple ULs
>
>
>
> ---
> You are currently subscribed to farcry-dev as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
> [EMAIL PROTECTED]
>
> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
> http://www.mxdu.com/ + 24-25 February, 2004
---
You are currently subscribed to farcry-dev as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004