Blog


Mobile menu and hamburger menu fix

Just paste the below code into the custom.js file to have no link (#) navigation links open their submenu when clicked ON MOBILE.

/* Code to make not linked ('#') nav bar slideout their submenu when clicking the link */
$( document ).ready(function() {
//variable needed to count each submenu, starts at 2 because 1 is the main menu
var number = 2; //Gets the main navigation, gets every link that has a child, and runs the following code on all of them $('#navigation_header').find(".has-child").each(function() {
//Checks if the links has a link of "#"
if($(this).children("a").first().attr("href") == "#"){
//if it does, sets the href and data-target to be #mm-number (example, #mm-2, #mm-3)
$(this).children("a").first().attr("href", "#mm-" + number);
$(this).children("a").first().attr("data-target", "#mm-" + number); }
//increments the number regardless if any changes are made
number++;
});
});
/*----------End MMenu code------------*/


Desktop menu fix

There are 2 codes here. The first one is for websites that have menus that slide out when clicked

/* Code to make it when you click on a no link navigation link ('#') that it opens the submenu on desktop */ $('#navigation_header').find('.navigation__list--sub').find('a[href^="#"]').click(function(e) {
var element = $(this).closest("li");
if (element.hasClass("open")) {
element.removeClass("open");
element.find("li").removeClass("open");
element.find("ul").slideUp(200);
} else {
element.addClass("open");
element.children("div").children("ul").slideDown(200);
element.siblings("li").children("div").find("ul").slideUp(200);
element.siblings("li").removeClass("open");
element.siblings("li").find("li").removeClass("open"); element.siblings("li").find("ul").slideUp(200);
}
});


The second code is for websites with submenus that just pop out without any animation. Example: Tulsa.
PLEASE NOTE: THIS CODE REQUIRES THE MOBILE FIX FOR IT TO WORK


/*------------code to get desktop links to open when no link (#) nav links----------------*/
$(window).on('hashchange', function(e){ $('#navigation_header').find("a[href$='"+location.hash+"']").parent().children('[class^="sublevel"]').children('ul').toggle(); window.location.hash = "";
});

If there is a website where this code doesn't work, please notify Brent Chiaramonti ([email protected])

Hours of Operation

Monday  

8:00 am - 6:00 pm

Tuesday  

8:00 am - 6:00 pm

Wednesday  

8:00 am - 6:00 pm

Thursday  

8:00 am - 6:00 pm

Friday  

8:00 am - 6:00 pm

Saturday  

Closed

Sunday  

Closed