..The problem was resolved without the use of javascript - see the comments.
Highlighting active menu item in blogger blogspot with javascript
-
29-06-2022 - |
Question
I've got an issue with this javascript that I use to highlight active items in a navigation tab. Everything's working fine here http://jsfiddle.net/gfkM4/148/ but in blogger it is not:
I added the class
.active_item {
background:#EFEFEF;
}
to my template and put this script in front of the closing header tag
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type='text/javascript'>
/* Function to add class active_item to navsub */
(function () {
$('.navsub li').bind('click', function (e) {
var el = $(this),
list = $('.navsub').find('li');
list.removeClass('active_item');
el.addClass('active_item');
});
}());
</script>
</head>
However, the class is not added as expected on blogger... Any hints are greatly appreciated!
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow