Tuesday 11 March 2014

dynamic menu li selected item highlighted using jquery or javascript

Use the following steps for archiving li selected item highlited.

Loop Code :1

@foreach (class obj in list)
        {
            <ul>
                <li  class="@obj.strName" style="font-weight:bold;" ><a href="#"  style="text-decoration:none;" >
 </a></li>
            </ul>
        }

Css: 2
.li
    {      
        background-color:#bb0d2d !important;
        color: white !important;      
    }

JQuery: 3
$('li').click(function () {
        $(this).addClass('li');
    });

No comments:

Post a Comment