"; $(".sb-right").find("ul").remove(); $(".menuContainer ").append(menu); //$(leftSideBar).appendTo(".left-sec"); $("#acdnmenu").clone().insertBefore($(".left-sec").find(".medium-sec")); //$("#hd-search").css("height", hhs);//old $("#hd-search").css("height", 0); $(".sb-left").find("#acdnmenu").remove(); } } } $(document).ready(function () { makeMenu(); $(window).resize(function () { makeMenu(); }); var focus_textbox = false; $(document).on("mouseleave", ".navi", function () { if (focus_textbox == false) { $(".new-menu").hide(); } }); $(document).on("click", ".parrent-li", function () { var currentHeight = $(this).css("height"); //debugger; if ($(this).hasClass("expand1234") == true) { $(this).removeClass("expand1234"); $(this).find(".arrowImage").addClass("remove"); $(this).find(".arrow-right").removeClass("active") $(this).slideDown('normal') $(this).find("ul").slideDown('normal') $(this).animate({ height: 40 }, 400); $(this).find("ul").animate({ height: 0 }, 400); } else { $(this).css("height", "100%"); $(this).find("ul").css("height", "100%"); var heig = $(this).height(); $(this).find("ul").css("height", "0%"); $(this).css("height", "0%"); $(this).addClass("expand1234"); $(this).animate({ height: heig }, 400); $(this).find("ul").animate({ height: heig - 40 }, 400); $(this).find(".arrowImage").addClass("current"); $(this).find(".arrow-right").addClass("active"); } }); $(document).on("mouseover", ".ui-tabs-anchor", function () { var href = $(this).attr("href"); $(".container.menubottom .description").hide(); $(href).show(); $(".ui-tabs-anchor").parent().removeClass("ui-tabs-active ui-state-active"); $(".ui-tabs-anchor[href='" + href + "'").parent().addClass("ui-tabs-active ui-state-active"); }); $(document).on("mouseleave", ".new-menu", function () { if (focus_textbox == false) { clearTimeout(timeOut); $(".new-menu").hide(); $(".menubottom").css("border-top-width", 0); $(".menuBottomWrap").css("margin-top", "0px"); clearSelectionClass(); } }); $(document).on("mouseover", ".new-menu", function (event) { clearTimeout(timeOut); event.stopPropagation(); //$(".menubottom").css("top","0px"); //alert($(this).attr("data-id")) clearSelectionClass() $('a[data-backid=' + $(this).attr("data-id") + ']').parent().addClass('mn_hoverd'); $('a[data-backid=' + $(this).attr("data-id") + ']').addClass('mna_hoverd'); }); $(document).on("mouseover", "body", function (event) { if (focus_textbox == false) { $(".new-menu").hide(); $(".menubottom").css("border-top-width", 0); clearSelectionClass(); } //timeOut = setTimeout(function(){menu_render = false;}, 3000); }); $(document).on("click", "#sb-site1, .left-sec, .container, #wrap, .bkgrnd-intro", function (e) { //$("#sb-site1").click(function(e) { if (focus_textbox) { focus_textbox = false $(".new-menu").hide(); $(".menubottom").css("border-top-width", 0); clearSelectionClass(); } }); function clearSelectionClass_notneeded() { for (var i = 0; i <= 6; i++) { try { $('a[data-backid=' + i + ']').parent().removeClass('mn_hoverd'); } catch (ex) { } try { $('a[data-backid=' + i + ']').removeClass('mna_hoverd'); } catch (ex) { } } } function clearSelectionClass() { $('ul.floating-menu li').each(function () { try { $(this).removeClass('mn_hoverd'); } catch (ex) { } try { $(this).children().removeClass('mna_hoverd'); } catch (ex) { } }); } $(document).on("click", ".openMenu", function (event) { //if (!menu_render) event.preventDefault(); // event.stopPropagation(); // clearTimeout(timeOut); // menu_render = true; hover1 = true; $(".menuBottomWrap").css("margin-top", "-51px"); $(".new-menu").hide(); event.stopPropagation(); var hoverId = $(this).attr("data-id"); //$(".new-menu[data-id='"+hoverId+"']").addClass("menubottom"); $(".menubottom").css("top", "-3px"); var ch = $(".menubottom").css("height") + 3; $(".menubottom").css("height", ch + "px"); var parentUl = $(this).parent().parent().get(0).className; if (parentUl == "floating-menu sml") { if ($(this).data("id") == "0") { $(".menubottom").css("border-top-width", "3px"); } else { $(".menubottom").css("border-top-width", "0"); } } else { $(".menubottom").css("border-top-width", "3px"); } $(".new-menu").hide(); $(".new-menu").css("display", "none"); $(".new-menu[data-id='" + hoverId + "']").show(); }); $(document).on("mouseover", ".menuContainer", function (event) { clearTimeout(timeOut); event.stopPropagation(); //$(".new-menu").hide(); //$(".menubottom").css("border-top-width",0); $(".menuBottomWrap").css("margin-top", "0px"); }); $(document).on("click", ".new-menu", function (event) { event.stopPropagation(); }); $(function () { if ($(window).width() < 768) { $(".openMenu.trusted-pros").html("Find Trusted Pros"); } $(document).on("click", "#nv_update_loc", function (e) { e.stopPropagation(); var loc = $("#nv_location").val(); arr_loc = loc.split(", "); if (loc != "") { $.post(location.protocol + "//" + location.host + "/nav_update_location.asp", { location: loc }) .done(function (data) { if (data != "") { $(".new-menu.start-1").html(data); $(".openMenu.trusted-pros").html("Find Trusted Pros in " + arr_loc[0]); $(".navi ul.floating-menu.sml").addClass("menu_xtnd"); $(".openMenu.trusted-pros").attr("href", $("#tab2").data("href")); } focus_textbox = false; $(".autocomplete-suggestions").hide(); e.stopPropagation(); }); } }); $(document).on("blur", "#nv_location", function (e) { if ($(this).val() == "") { $(this).val($(this).data("location")); } }); $(document).on("focus", "#nv_location", function (e) { focus_textbox = true; $(this).val(""); $(this).autocomplete({ serviceUrl: location.protocol + "//" + location.host + "/searchfield-city-provabbr.asp", autoSelectFirst: true, showNoSuggestionNotice: true, onSearchStart: function (query) { focus_textbox = true; }, onSelect: function (suggestion) { e.stopPropagation(); } }); }); //$(document).on("click", "ul.links.lvl7 li a", function(event){ //	event.preventDefault(); //	var city = encodeURI($(this).data("city").trim().toLowerCase()); //	var provabbr = $(this).data("loc").replace(",", "").trim().toLowerCase();; //	$.post( location.protocol +"//" + location.host + "/set-location-menu.asp", { navcity: city, navprov: provabbr }) //	.done(function( data ) { //	location.href = location.protocol +"//" + location.host + "/" + provabbr.replace(" ", "-") + "/" + city.replace(" ", "-"); //	}); //	}); $(document).on("click", "#navm_close", function (event) { $(".new-menu").hide(); $(".menubottom").css("border-top-width", 0); clearSelectionClass(); $(".autocomplete-suggestions").hide(); }); }); $(document).on("mouseover", ".openMenu", function (event) { event.stopPropagation(); //if (menu_render) { //	clearTimeout(timeOut); hover1 = true; //	menu_render= true; $(".menuBottomWrap").css("margin-top", "-51px"); $(".new-menu").hide(); event.stopPropagation(); var hoverId = $(this).attr("data-id"); //$(".new-menu[data-id='"+hoverId+"']").addClass("menubottom"); $(".menubottom").css("top", "-3px"); var ch = $(".menubottom").css("height") + 3; $(".menubottom").css("height", ch + "px"); var parentUl = $(this).parent().parent().get(0).className.trim(); if (parentUl == "floating-menu sml" || parentUl == "floating-menu sml menu_xtnd") { if ($(this).data("id") == "0") { $(".menubottom").css("border-top-width", "3px"); } else { $(".menubottom").css("border-top-width", "0"); } } else { $(".menubottom").css("border-top-width", "3px"); } $(".new-menu").hide(); $(".new-menu").css("display", "none"); $(".new-menu[data-id='" + hoverId + "']").show(); // } }); $(".open-close-menu").bind('touchstart click', function (e) { if ($("#hd-search").hasClass("close-smenu") == true) { // $("#hd-search").addClass("open-smenu"); $("#hd-search").removeClass("close-smenu"); $("#hd-search").addClass("open-smenu", 400); //$("#hd-search").slideUp( "slow" ); $(".open-close-menu").addClass("search-icon-c"); $(".open-close-menu").removeClass("search-icon-m"); $(".categories-mob").css("margin-top", "220px"); $("#hd-search").css("height", hhs); } else { $("#hd-search").removeClass("open-smenu"); $("#hd-search").addClass("close-smenu", 400); $(".categories-mob").css("margin-top", "70px"); //$("#hd-search").slideDown( "slow" ); $(".open-close-menu").removeClass("search-icon-c"); $(".open-close-menu").addClass("search-icon-m"); $("#hd-search").css("height", 0); } ScrollIt(); }); });