highlight the menu item according to the page
-
hi i have different list in accordion format i want to highlight the list item according to the page
the above list is the sample list and i am using bellow code $(document).ready(function($){ $('#accordion-4').dcAccordion({ eventType: 'hover', autoClose: true, saveState: true, disableLink: true, menuClose: false, speedIn:10, speedOut:10, showCount: false, }) }); can any one help to me.
-
hi i have different list in accordion format i want to highlight the list item according to the page
the above list is the sample list and i am using bellow code $(document).ready(function($){ $('#accordion-4').dcAccordion({ eventType: 'hover', autoClose: true, saveState: true, disableLink: true, menuClose: false, speedIn:10, speedOut:10, showCount: false, }) }); can any one help to me.
You could do this several way such as sending a numeric ID to a javascript function that corresponds to a link in your list. When clicked, and/or the page has done a round trip read that numeric ID back into a function that highlights that link. This is just a crude example of javascript that take an element's ID and turns its background bright Yellow.
function highlight(linkID)
{
var link = document.getElementById(linkID);
link.style.backgroundColor = "#FFFF00";
}If you want to go about it in a STATIC way you could set up each page where the link itself has not only a CSS class definition but an ID as well, for example:
Now define your CSS
.sub-menu { ..... }
#CURRENT_PAGE { background-color:#FFFF00; }The choice is up to you, good luck!
I once knew a man with a wooden leg named Smith, I never asked what he named his other leg.