$(document).ready(function() { $('.SPRMenuList').find(".menuItem .dropdown-menu").each(function() { if ($(window).width() > 767) { var widthstr = ($(this).find('.data-block').length * 242 + 40) + 'px'; if ($(this).find('.data-block').length <= 2) { $(this).css('min-width', widthstr) } else { $(this).css('position', 'fixed') } } }); }); $(document).ready(function() { var initiated = !1; var window_width = $(window).width(); $(window).resize(function() { if (initiated == !1) { initiated = !0; setTimeout(function() { $(window).trigger('resizeTriggered'); initiated = !1 }, 300) } window_width = $(window).width() }); $(window).on('resizeTriggered', function() { if (window_width >= 768) { $(".SprintMenuContainer").css("bottom", "0px") } }); var megamenuslide = new Array(); var megamenuVerticalslide = new Array(); $(".SPRITMenuItem.menuItem").bind({ mouseenter: function(e) { for (i = 0; i < $('.SPRITMenuItem:hover').length; i++) { megamenuslide[i] = new slidediv(); megamenuslide[i].Init("SPRITMenuItem:hover", "alldatablocks", "data-block", i) } for (c = 0; c < $('.SPRITMenuItem:hover .alldatablocks .data-block').length; c++) { megamenuVerticalslide[c] = new slideVertical(); megamenuVerticalslide[c].Init("SPRITMenuItem:hover .alldatablocks .data-block", "content", "megamenuList", c) } } }); $(".closeOffer").on('click', function(c) { $(this).parent().fadeOut('slow') }); $("div.SPRITMenuItem").bind("click mouseenter", function() { var drop_down_margin = 0; if ($(".offer_top_div").length && $(".offer_top_div").css("display") == "block") { var offer_height = $(".offer_top_div")[0].clientHeight; var window_pos = $(window).scrollTop(); if (window_pos <= offer_height) { drop_down_margin = offer_height - window_pos } } $(".SPRITMenuItem .dropdown-menu").css("margin-top", drop_down_margin) }); if ($(".quickaccess")[0]) { if (window.location.href.indexOf("#") > -1) { var hash = "#" + window.location.href.split("#").pop(); checkPage(hash) } } if ($(".SprintMenuContainer.nnMenucontainer").length > 0) { $(".SprintMenuContainer.nnMenucontainer").find(".MainList").each(function() { if ($(this).find('.ongoingblink').length > 0) { $(this).find(".listHolder").children(".SubList").each(function() { $(this).find(".SubList").each(function() { if ($(this).parents(".SubList").hasClass('ongoing')) { if ($(this).parents(".SubList").hasClass('upcoming')) { $(this).parents(".SubList").removeClass('upcoming') } return !1 } else { if ($(this).find(".ongoing").length > 0) { $(this).parents(".SubList").addClass("ongoing"); if ($(this).parents(".SubList").hasClass('upcoming')) { $(this).parents(".SubList").removeClass('upcoming') } } else if ($(this).find(".upcoming").length > 0) { $(this).parents(".SubList").addClass("upcoming") } } }) }) } }) } if ($(window).width() < 991) { if ($(".SprintMenuContainer.nnMenucontainer").length > 0) { $(".nnMenucontainer").addClass("customMenuMobile") } } else { if ($(".tr2-header.marketplace").length > 0) { if ($(".TRLoginRegister").find(".profileData").length > 0) { $(".tr2-header.marketplace").addClass("mydashboard") } $(window).scroll(); $(window).scroll(function() { var scroll = $(window).scrollTop(); if (scroll > 276) { $(".tr2-header.marketplace").css("opacity", "1") } else { if ($(".menubodyoverlay").css("height") == "0px") { $(".tr2-header.marketplace").css("opacity", "0.85") } } }) } $(".sprcustomMenu").find(".mainlistHolder").find(".MainList").hover(function() { $(".menubodyoverlay").css("height", "100%"); $(".tr2-header.marketplace").css("opacity", "1"); $("body").addClass("nobodyscroll") }, function() { $(".menubodyoverlay").css("height", "0"); $(".tr2-header.marketplace").css("opacity", "0.85"); $("body").removeClass("nobodyscroll") }) } $(".customMenuMobile").find(".MainList").children("a").unbind().bind("click", function(e) { $(this).siblings("ul").css("display", "flex"); $(".MainList").children("a").css("display", "none") }); $(".sprcustomMenu").find(".MainList").hover(function() { $(this).addClass("mainlisthover") }); $(".sprcustomMenu").find(".listHolder").find(".SubList").hover(function() { $(this).parents(".MainList").removeClass("mainlisthover") }); $(".customMenuMobile").find(".SubList").find("ul").removeClass("dropdown-menu"); $(".customMenuMobile").find(".SubList").find("ul").removeAttr("style"); $(".js-closebtn").unbind().bind("click", function(e) { $(".nnMenucontainer").find(".sprcustomMenu").removeClass("mobilemenuexpand"); $(".menubodyoverlay").css("height", "0"); $("body").removeClass("nobodyscroll"); var zopim = $("body").find(".zopim"); $(zopim.eq(2)).show() }); $(".sprintpen").unbind().bind("click", function(e) { $(".nnMenucontainer").find(".sprcustomMenu").addClass("mobilemenuexpand"); $("body").addClass("nobodyscroll"); $(".menubodyoverlay").css("height", "100%"); var zopim = $("body").find(".zopim"); $(zopim.eq(2)).hide(); $('.menubodyoverlay').unbind().bind('click', function() { if ($(".customMenuMobile").find('.MainList > a').css("display") === "none") { $(".customMenuMobile").find(".js-menuback").trigger("click") } $(".nnMenucontainer").find(".sprcustomMenu").removeClass("mobilemenuexpand"); $("body").removeClass("nobodyscroll"); $(".menubodyoverlay").css("height", "0"); var zopim = $("body").find(".zopim"); $(zopim.eq(2)).show() }) }); $(".listHolder > .SubList > a").bind("click", function() { $(this).parents(".SubList").siblings().children("ul").slideUp(200); $(this).parents(".SubList").siblings().removeClass("selected"); if ($(this).parents(".SubList").hasClass("selected")) { $(this).siblings("ul").slideUp(200); $(this).parents("li.SubList").removeClass("selected") } else { $(this).parents("li.SubList").addClass("selected"); $(this).siblings("ul").slideDown(200) } }); $(".js-menuback").unbind().bind("click", function(e) { $(this).parents("ul").css("display", "none"); $(".MainList").children("a").css("display", "flex") }) }); $("#layout-list").on("click", function(){ $("#sec-mockGrid").css("display", "none"); $("#sec-mockList").css("display", "block"); $("#sec-gridlable").css("display", "none"); $("#sec-listlable").css("display", "block"); $("#layout-list").removeClass("layout-list"); $("#layout-list").addClass("layout-list-active"); $("#layout-grid").addClass("layout-grid"); $("#layout-grid").removeClass("layout-grid-active"); }); $("#layout-grid").on("click", function(){ $("#sec-mockList").css("display", "none"); $("#sec-mockGrid").css("display", "block"); $("#sec-listlable").css("display", "none"); $("#sec-gridlable").css("display", "block"); $("#layout-grid").removeClass("layout-grid"); $("#layout-grid").addClass("layout-grid-active"); $("#layout-list").addClass("layout-list"); $("#layout-list").removeClass("layout-list-active"); });