RE: [PHP] Generating foldout menus in php
| From: | Arno Kuhl | Date: | Tue, 04 Sep 2007 07:42:30 +0000 |
| Subject: | RE: [PHP] Generating foldout menus in php | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-261676@lists.php.net to get a copy of this message | ||
>This may not be directly php related but I'm hoping that generating the
>code with PHP will keep it on topic.
>
>I'm looking for a way to generate dropdown/foldout menus (horizontal
>and
>vertical) on the fly, but all the javascript solutions I've seen use
>absolute or relative pixel positioning, which means I can't use them
>because I don't know at the time of generating a specific menu item how
>many pixels across or down the preceding items have already used. I'm
>currently using a javascript menu that works really well, but all the
>top-level menu items have to be preset with specific x-y pixel
>coordinates, and all the subsequent items are then relative to the
>top-level items. So I can generate the second-level and subsequent
>items on the fly but not the top-level items. Is there a way to use css
>or dhtml or something else (maybe something in javascript that I missed) to
do this?
>
>Thanks
>Arno
Arno:
There's really no way to do this just using php. I can envision a way to use
php with a couple of other languages to provide drop-down and pop-out menus,
but that would be more complicated than just using css with js, like so:
http://sperling.com/examples/menuh/
http://sperling.com/examples/menuv/
Why complicate your life?
Cheers,
tedd
--
Hi tedd
Thanks, that's pretty much what I was looking for. I found something similar
at cssplay, except the examples I saw didn't use .htc file. Like your
examples the cssplay code only runs on IE5.5 and up (and other browsers).
Not sure yet if that would be a problem. I don't have IE5 to test with, so I
don't know if there's a graceful fallback that would still allow the user to
navigate. As you said, it doesn't look like there's a solution to fit all
browsers and versions.
Cheers
Arno