Custom User Title
Join Date: Jul 2006
Location: At home
|
Hey guys !
I need to hide a <li> (it's a menu item with sub-items) if there's no other <ul><li> or <a> in it. Can it be done in php or do I need to use Javascript ? I'm pretty beginner in both, anyone can help me out on this one ? The item that needs to be removed can be set to css display:none, it's not critical if it's rendered then hidden... So the "class1" <li> wouldn't be shown : Code:
<ul>
<li class="class1">This is a list item</li>
</ul> "class2" <li> would be shown, class3 not:Code:
<ul>
<li class="class2"><a href="#">Open sub menu</a>
<ul>
<li class="class3">This is a subitem</li>
</ul>
</li>
</ul> Dave Mustaine :"God created whammy bars for people who don't know how to solo." Last edited by dmegatool : 2012-09-21 at 11:05. |
quote |
http://ga.rgoyle.com
Join Date: May 2004
Location: In your dock hiding behind your finder icon!
|
Mike life easy on yourself and add some extra classes with php.
Also, there are a shit-tonne of javascript + css dropdown, pop-up, slide-out bound in menu systems if you search around google. http://www.alistapart.com is always a good place to start for this kind of thing. OK, I have given up keeping this sig up to date. Lets just say I'm the guy that installs every latest version as soon as its available! |
quote |
Posting Rules | Navigation |
|
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Quotes and html entities in MySql and HTML | nassau | Programmer's Nook | 4 | 2006-10-02 03:39 |
New store item | alcimedes | AppleOutsider | 22 | 2006-06-29 21:21 |
do something for each item in array except last one | nassau | Programmer's Nook | 13 | 2006-01-14 15:01 |
Removing Stubborn Item From Start Up List | stacy | Genius Bar | 3 | 2006-01-07 11:42 |
Help with removing item from finder... | .Hack | Genius Bar | 3 | 2005-07-12 22:50 |