Mon, 2010-03-15 00:10
Hi
I have been trying to get the li in a menu to show as active when the sub category flies out.
Here is what i have so far.
#mainmenu-nav { list-style: none; list-style-type: none; width:153px; margin:-5px 0 7px 3px; padding:0; font-size:12px; } .li-nav a { padding: 2px 1px; width: 151px; display: block; text-indent:2px; text-decoration: none; margin:0; color:#646464; } .li-nav a:hover { background-color:#000; color:#fff; text-decoration:none; } .ul-nav, .li-nav { display: block; list-style: none; } .ul-nav { width: 153px; padding:0; } .li-nav {float: left; margin:0; } .li-nav .ul-nav { display: none; position: absolute; background-color:#c6c6c6; margin-left: 136px; margin-top: -19px; border-left: 1px solid #000; border-right: 1px solid #000; border-bottom: 1px solid #000; border-top: 4px solid #000; z-index: 99; }
here is the markup [i'm using a cart based on php]
<ul id="mainmenu-nav" style="overflow:hidden;"> <li class="li-nav"><a href="index.php">{LANG_HOME}</a></li> <!-- BEGIN: a --> <!-- BEGIN: ul_start --> <ul class="ul-nav"> <!-- END: ul_start --> <!-- BEGIN: li_start --> <li class="li-nav"> <!-- END: li_start --> <a href="index.php?_a=viewCat&catId={DATA.cat_id}">{DATA.cat_name}</a> <!-- BEGIN: li_end --> </li> <!-- END: li_end --> <!-- BEGIN: ul_end --> </ul> </li> <!-- END: ul_end --> <!-- END: a --> <!-- BEGIN: gift_certificates --> <li class="li-nav"> <a href="index.php?_a=giftCert">{LANG_GIFT_CERTS}</a></li> <!-- END: gift_certificates --> <!-- BEGIN: sale --> <li class="li-nav"> <a href="index.php?_a=viewCat&catId=saleItems">{LANG_SALE_ITEMS}</a></li> <!-- END: sale --> </ul>
and what i'd like to achieve is the li-nav to stay active when the sub-category flies out. So if it flies out black in colour then i'd like the li-nav to also stay highlighted as black.
Hope i made some sense!
THanx
Mon, 2010-03-15 03:47
#1
:active style is active when
:active works when you have a mousedown event on that item.
Mon, 2010-03-15 09:34
#2
Thank-you for your reply...
Thank-you for your reply... so would you know how i can get the li-nav to have a black background color? whilst the sub-menu is sliding out?
thanx
