jQuery(document).ready(function(){ /* gestione menù classico*/ var $id_menu = '#menu_1424'; $menu = jQuery($id_menu); $btn = jQuery('.op_block'); jQuery($btn).click(function() { jQuery($id_menu+' .level1').toggleClass('slide-menu'); $btn.toggleClass('open'); }); /* jquery per chiudere la tendina del menu al click esterno alla tendina */ jQuery(document).click(function(event) { if(jQuery(event.target).parents('.op_block').size()|(jQuery(event.target).hasClass('open'))|(jQuery(event.target).parents('ul#root_1424 li').size() ) ) return; jQuery(".op_block").removeClass('open'); if(jQuery(".level1").hasClass('slide-menu')) jQuery(".level1").removeClass('slide-menu'); }); //LB.Header.init(jQuery('#contenuto_181709')); var catMenu = jQuery('.cat-menu'); if(catMenu.length>0){ Site.MenuCat.init(catMenu); } jQuery('.plus').slick({ dots: true, infinite: true, speed: 800, arrows:true, slidesToShow: 4, slidesToScroll: 1, autoplay: true, autoplaySpeed: 5000, responsive: [ { breakpoint: 1200, settings: { slidesToShow: 3, slidesToScroll: 1, infinite: true } }, { breakpoint: 991, settings: { slidesToShow: 2, slidesToScroll: 1, infinite: true, } }, { breakpoint: 767, settings: { slidesToShow: 1, slidesToScroll: 1, } }, { breakpoint: 480, settings: { slidesToShow: 1, slidesToScroll: 1, centerMode: false, arrows:false } } ] }); jQuery('.carousel-produttori').slick({ dots: false, infinite: true, speed: 800, arrows:true, slidesToShow: 7, slidesToScroll: 1, autoplay: true, autoplaySpeed: 4000, responsive: [ { breakpoint: 1200, settings: { slidesToShow: 4, slidesToScroll: 1, infinite: true } }, { breakpoint: 991, settings: { slidesToShow: 2, slidesToScroll: 1, infinite: true, } }, { breakpoint: 767, settings: { slidesToShow: 1, slidesToScroll: 1, } }, { breakpoint: 480, settings: { slidesToShow: 1, slidesToScroll: 1, centerMode: false, arrows:true } } ] }); jQuery('.riquadro-novita .container-prodotti .cat_cb').remove(); jQuery('.riquadro-novita .container-prodotti').slick({ dots: false, infinite: true, speed: 800, arrows:true, slidesToShow: 1, slidesToScroll: 1, autoplay: true, autoplaySpeed: 7000 }); }); /* *********************************************** */ //APRO MENU LINGUE jQuery(document).ready(function(){ jQuery('.tendina-lingue-2').click(function() { var lingua = jQuery(this).next().next(); if( lingua.is(':hidden') ) { lingua.slideDown(); }else{ lingua.slideUp(); } }); jQuery("#select_lingue-2").click(function() { jQuery(this).slideUp(); }); }); /* ********************************************************************* */ /* jquery per chiudere la tendina delle lingue al click esterno alla tendina */ jQuery(document).click(function(event) { if(jQuery(event.target).parents('.tendina-lingue-2').size()|(jQuery(event.target).hasClass('tendina-lingue-2'))) return; if(!jQuery("#select_lingue-2").is(':hidden')) jQuery("#select_lingue-2").fadeOut(250); }); function showMe(elem){ anim = jQuery(elem).attr('data-anim'); jQuery(elem).addClass('animated '+anim); jQuery(elem).animate({ opacity:1 }, 700, function() { }) } function goToByScroll(param){ jQuery('html, body').animate({scrollTop: jQuery(param).offset().top-100}, 2000, "easeInOutQuad"); } jQuery(window).on('scroll load', function(){ setTimeout(function() { // Do something after 5 seconds jQuery('.hideme, .shakeme').each( function(i){ var bottom_of_object = jQuery(this).offset().top + jQuery(this).height(); var bottom_of_window = jQuery(window).scrollTop() + jQuery(window).height(); if( bottom_of_window > bottom_of_object ){ showMe(this); } }); }, 300); }); /* adatta altezza contenuti affiancati */ jQuery(window).on('load resize', function(){ if(window.innerWidth > 992){ jQuery('.adattHeight').each(function(){ $height = jQuery(this).next().height(); console.log($height) if($height) { jQuery(this).height($height -30); } else if(!$height) { $height = jQuery(this).prev().height(); jQuery(this).height($height -30); } }); } }) function add_slide_menu(item) { jQuery('li' + item + ' .level2').toggleClass('slide-menu'); } function back_menu(item) { jQuery('li' + item + ' .level2').toggleClass('slide-menu'); } var LB = {}; LB.Header = { init: function(element){ jQuery(window).scroll(function(){ if(window.innerWidth > 992){ var scrollpos = (document.documentElement.scrollTop || document.body.scrollTop); if(scrollpos > 280){ element.fadeIn().css('visibility','visible'); } else { element.fadeOut().css('visibility','hidden'); } } }); } }; /* ***************gestione tab a fisarmonica*********** */ jQuery(window).load(function(){ // Gestione degli slider jQuery('.slider-titolo').click(function(){ if(!jQuery(this).hasClass('opened')){ jQuery('.slider-titolo.opened').removeClass('opened'); jQuery(this).addClass('opened'); jQuery('.slider-corpo.opened').slideUp('fast',function() { jQuery(this).removeClass('opened'); }) jQuery(this).next().slideDown('fast',function() { jQuery(this).addClass('opened'); }); }else{ jQuery(this).removeClass('opened'); jQuery('.slider-corpo.opened').slideUp('fast',function() { jQuery(this).removeClass('opened');}); } }); }); var FA = {}; FA.SchedaProd = { init: function(){ jQuery('.sidebar').remove(); jQuery('.main-content').removeClass().addClass('col-xs-12').css({'padding-left':'5px'}); jQuery('.catalog_titolo').remove(); } }; FA.Carrello = { init: function(){ jQuery('.checkout .qta_carrello').removeAttr('style'); jQuery('.checkout .note-ordine textarea').removeAttr('style'); } }; var Site = {}; Site.Responsive = { xsMax: 767, smMax: 991, mdMax: 1999, isXs: function(){ if(window.innerWidth <= this.xsMax){ return true; } return false; }, isSm: function(){ if(window.innerWidth <= this.smMax && window.innerWidth > this.xsMax){ return true; } return false; }, isMd: function(){ if(window.innerWidth <= this.mdMax && window.innerWidth > this.smMax){ return true; } return false; }, isLg: function(){ if(window.innerWidth > this.mdMax){ return true; } return false; } }; Site.MenuCat = { init: function(el){ if(el.length===0){ return; } el.find('.cat a').each(function(){ var urlCatBase = jQuery(this).attr('href'); var child = jQuery(this).parent().next(); if(child.is('ul')){ //child.prepend('