1(function($) { 2 $(document).ready(function(){ 3 4 // console.log('Init header.js') ; 5 6 // Menu réduit on scroll 7 $('.header').clone().addClass('scrolled-header').insertAfter('.footer') ; 8 function check_mini_header() { 9 if($(document).scrollTop() > 300) { 10 if(!$('body').hasClass('mini-header')) { 11 $('.scrolled-header').animate({ 12 top:'0', 13 }) 14 // console.log('go'); 15 } 16 $('body').addClass('mini-header') ; 17 } else { 18 if($('body').hasClass('mini-header')) { 19 $('.scrolled-header').animate({ 20 top:'-200', 21 }, 1000) 22 } 23 $('body').removeClass('mini-header') ; 24 } 25 } 26 check_mini_header() ; 27 $(window).scroll(function(){ 28 check_mini_header() ; 29 }); 30 31 // Menu mobile 32 function init_menu_mobile() { 33 //$('.sub-menu .sub-menu').css('display','none') ; 34 $('.sub-menu .menu-item-has-children > a').on('click',function() { 35 $(this).siblings('.sub-menu').slideToggle() ; 36 $(this).closest('li').toggleClass('open') ; 37 return false ; 38 }) 39 $('body').addClass('init-menu-mobile'); 40 } 41 $('.menu-button').on('click', function() { 42 if(!$('body').hasClass('init-menu-mobile')) { 43 init_menu_mobile(); 44 } 45 $(this).closest('.header').find('nav').fadeToggle(); 46 $('body').toggleClass('menu-ouvert'); 47 return false; 48 }); 49 50 }) 51}(jQuery));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.