Re: PEAR HTML_Menu
| From: | Richard Quadling | Date: | Mon, 07 Jun 2010 22:56:13 +0000 |
| Subject: | Re: PEAR HTML_Menu | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-30607@lists.php.net to get a copy of this message | ||
On 7 June 2010 16:51, Jamie Kahgee <jamie.kahgee@gmail.com> wrote:
> If I wanted to apply an id/class to the last parent item in a menu - is it
> possible w/out modifying this script?
>
> I'm using the HTML_Menu_DirectTreeRenderer and need a marker on the last
> <li> in the main list
>
> ie:
>
> <ul>
> <li>Menu item 1
> <ul>
> <li>Menu item 1.1</li>
> <li>Menu item 1.2</li>
> </ul>
> </li>
> <li* id="lastli"*>Menu item 2</li> <-- need to add class here
> </ul>
>
>
>
> Thanks,
> Jamie K.
>
You could use JavaScript ...
$$('ul li').last().id = 'lastli'
Maybe.
(Using prototype.js for that).
But I'm not 100% sure on what order the CSS selectors would give up the list.
Maybe ...
$$('ul').first().select('li').last()
--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling