Introduction
This simple jQuery will check the URL of the current page and see if it matches with the URLs in the menu, then an "active" class will be added to the menu item automatically.External Scripts
Jquery Library v1.0.0 or higher (?)Live Demo
DemoJScript
Go to Blogger » Template » Backup your Template » and Edit HTMLCopy the following code and paste it before </head>
<script>
jQuery(document).ready(function($){
var url = window.location.href;
$('#header li a[href="'+url+'"]').addClass('active');
});
</script>
Final Words
So that's it! Don't hesitate to ask. Enjoy blogging!Hey! Did you find this tutorial useful? Share your thoughts by leaving a comment below!
Rate This Article
Thanks for reading: Make your menu item active using this simple jquery, Stay tune to get latest Blogging Tips.