Copy link to clipboard
Copied
Hi
I just added a new Liquid/ Bootstrap menu as per the article:
However I cannot find a solution to add the 'active' class to an active menu item.
see page:
Carousel Template for Bootstrap
Also, any idea why "<li style="list-style: none"> </li>" is added to rendered markup ?
Any ideas?
Thanks
Copy link to clipboard
Copied
I found this simple JS script that adds the 'active' state if anyone is interested. Just change the element ID and Tag name for what ever you use,
<script>
function setActive() {
aObj = document.getElementById('navbar').getElementsByTagName('a');
for(i=0;i<aObj.length;i++) {
if(document.location.href.indexOf(aObj.href)>=0) {
aObj.className='active';
}
}
}
window.onload = setActive;
</script>
Find more inspiration, events, and resources on the new Adobe Community
Explore Now