I have “navigation.html” (static coded navigtaion ) file loaded on multiple pages, using jQuery .load()
Now I need to dynamically set active <li> for each page user clicking on. I can not use body id for specific reasons.
Any other ways to do this?
I have navigation.html (static coded navigtaion ) file loaded on multiple pages, using jQuery
Share
If you can identify your current page by class or id (ex: body > div#contacts) for contacts.html and this class/id is unique then you have to match it with you navigation, other way is to match
window.location.hrefvalue (parsed if you want) against your navigation.changeActiveLinkis defined in JS (ex:init.js) file which you include to each pageThis line is called from each file when “init.js” is included.