Show active parent with matching submenu when page is loaded jQuery - Ayush Shrestha || UI/UX || Front-end || Angular || React || Wordpress

Show active parent with matching submenu when page is loaded jQuery

Stack Overflow
$(document).ready(function() {
$(".nav li [href]").each(function() {
    if (this.href == window.location.href) {
        $(this).css("background", "red");
       $(this).addClass("hover");
       $(this).parent().find('ul.sub').css("left","0");
    }
}); });

more

Leave a Reply

Your email address will not be published. Required fields are marked *