Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
trash
/
vhost_www.arlenshop.fr_1556185825
/
htdocs
/
modules
/
csmegamenu
/
js
/
/srv/data/trash/vhost_www.arlenshop.fr_1556185825/htdocs/modules/csmegamenu/js/csmegamenu_front.js
$(window).load(function(){ resizeWidth(); }); (function($,sr){ var debounce = function (func, threshold, execAsap) { var timeout; return function debounced () { var obj = this, args = arguments; function delayed () { if (!execAsap) func.apply(obj, args); timeout = null; }; if (timeout) clearTimeout(timeout); else if (execAsap) func.apply(obj, args); timeout = setTimeout(delayed, threshold || 100); }; } // smartresize jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); }; })(jQuery,'smartresize'); var TO = false; $(window).smartresize(function(){ if(TO !== false) clearTimeout(TO); TO = setTimeout(resizeWidth, 400); //400 is time in miliseconds }); function resizeWidth() { var number1=123.15; var number=Math.round(number1).toFixed(2); var menuWidth = 1180; var numColumn = 6; var currentWidth = $("#menu").outerWidth()-2; if (currentWidth <= menuWidth) { new_width_column = currentWidth / numColumn; $('#menu div.options_list').each(function(index, element) { var options_list = $(this).next(); $(this).width(parseFloat(options_list.css("width"))/menuWidth*numColumn * new_width_column); }); $('#menu div.option').each(function(index, element) { var option = $(this).next(); var woption=parseFloat(option.css("width"))/menuWidth*numColumn * new_width_column-0.5; var woption1=Math.round(woption).toFixed(2); $(this).width(woption1); var wul= parseFloat(option.css("width"))/menuWidth*numColumn * new_width_column-0.5; var wul1=Math.round(wul).toFixed(2); $("ul", this).width(parseFloat(option.css("width"))/menuWidth*numColumn * new_width_column); }); $('#menu ul.column').each(function(index, element) { var column = $(this).next(); var wul=parseFloat(column.css("width"))/menuWidth*numColumn * new_width_column-0.5; var wul1=Math.round(wul).toFixed(2); $(this).width(wul1); }); } $('#menu ul > li > a + div').each(function(index, element) { var menu = $('#menu').offset(); var dropdown = $(this).parent().offset(); i = (dropdown.left + $(this).outerWidth()) - (menu.left + $('#menu').outerWidth()); if (i > 0) { $(this).css('margin-left', '-' + i + 'px'); } else $(this).css('margin-left', '0px'); }); } function menuDropDown() { $("li a.title_menu_parent").hover( function () { $(this).next().slideDown(300); },function () { $(this).parent().mouseleave(function() { $(".options_list").slideUp(100); }); }); } $(window).ready(function(){ $('#megamenu-responsive-root li.parent').prepend('<p>+</p>'); $('.menu-toggle').click(function(){ $('.root').toggleClass('open'); }); $('#megamenu-responsive-root li.parent > p').click(function(){ if ($(this).text() == '+'){ $(this).parent('li').children('ul').slideDown(300); $(this).text('-'); }else{ $(this).parent('li').children('ul').slideUp(300); $(this).text('+'); } }); if(moreInsert1>0 &&moreInsert2>0) { addMoreOnLoad(moreInsert1,moreInsert2,numLiItem,htmlLiHide1,htmlLiHide2); addMoreResponsive(moreInsert1,moreInsert2,numLiItem,htmlLiHide1,htmlLiHide2); } /*-------------------------*/ menuDropDown(); $(window).resize(function(){ menuDropDown(); }); });