1/*----------------------------------------------------------------------------*/ 2//'HEADER MENU 3/*----------------------------------------------------------------------------*/ 4function loadHeaderMenu() { 5 //'Ajoute la fonction sur le clic du bouton 'menu' 6 $(".MenuButton").click(function () { 7 $(".MenuMobile").slideToggle("slow"); 8 }); 9} 10 11//'Affiche ou cache le menu mobile en fonction de la largeur du navigateur 12$(window).resize(function () { 13 var clientWidth = $(window).width(); 14 if (clientWidth > 1050) { 15 $(".MenuMobile").css("display", ""); 16 } 17 18}); 19/*----------------------------------------------------------------------------*/ 20 21 22/*----------------------------------------------------------------------------*/ 23//'CLOSE MESSAGE ALERT 24/*----------------------------------------------------------------------------*/ 25function loadCloseMessageAlert() { 26 $(".MessageAlertContent .ico-fermer").on("click", function () { 27 closeMessageAlert(); 28 }); 29} 30function closeMessageAlert() { 31 $(".HideSelector").fadeOut('fast'); 32} 33function closeMessageAlertAfterDelay(pDelay) { 34 $(".MessageAlertContent .ico-fermer").hide(); 35 setTimeout(function () { 36 $(".HideAfterSelector").fadeOut('fast'); 37 }, pDelay*1000); 38} 39/*----------------------------------------------------------------------------*/ 40 41 42/*----------------------------------------------------------------------------*/ 43//'POPIN 44/*----------------------------------------------------------------------------*/ 45 46//Variables constantes 47var popin_MASK = ".mask_bg"; 48var popin_CLOSE = ".popin_close"; 49var i; 50 51function loadPopinScript() { 52 //Evenements ajouté sur le bouton close 53 $(popin_CLOSE).click(function () { 54 disablePopins(); 55 }); 56 //Evenements ajouté sur le click du mask 57 $(popin_MASK).click(function () { 58 disablePopins(); 59 }); 60} 61 62function loadPopin(pPopin, pAnim=true) { 63 var windowHeight = document.documentElement.clientHeight; 64 //Fond opaque 65 $(popin_MASK).css({ 66 "opacity": "0.5", 67 "height": windowHeight 68 }); 69 70 //Ouverture popin 71 if (pAnim === true) { 72 $(popin_MASK).fadeIn("slow"); 73 $(pPopin).slideDown("slow"); 74 } 75 else { 76 $(popin_MASK).show(); 77 $(pPopin).show(); 78 } 79} 80 81function disablePopins() { 82 $(".popin").fadeOut("fast"); 83 $(popin_MASK).fadeOut("fast"); 84 //'Arrete toutes les video dans des iframe qui ont pour class youtubevideoplayer 85 $(".youtubevideoplayer").each(function(){ 86 this.contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*'); 87 }); 88} 89/*----------------------------------------------------------------------------*/ 90 91/** 92 * detecte si l ecran est "touchable" 93 **/ 94function isTouchDevice() { 95 return ('ontouchstart' in window) || navigator.maxTouchPoints > 0; 96} 97 98 99/*----------------------------------------------------------------------------*/ 100//'TOOLTIP 101/*----------------------------------------------------------------------------*/ 102function loadTooltipScript() { 103 if (isTouchDevice()) { 104 // Sur mobile : pas de tooltip, clic normal 105 return; 106 } 107 var targets = $('[rel~=tooltip]'), 108 target = false, 109 tooltip = false, 110 title = false; 111 112 targets.bind('mouseenter', function () { 113 target = $(this); 114 tip = target.attr('title'); 115 tooltip = $('<div id="tooltip"></div>'); 116 117 if (!tip || tip == '') 118 return false; 119 120 target.removeAttr('title'); 121 tooltip.css('opacity', 0) 122 .html(tip) 123 .appendTo('body'); 124 125 var init_tooltip = function () { 126 if ($(window).width() < tooltip.outerWidth() * 1.5) 127 tooltip.css('max-width', $(window).width() / 2); 128 else 129 tooltip.css('max-width', 340); 130 131 var pos_left = target.offset().left + (target.outerWidth() / 2) - (tooltip.outerWidth() / 2), 132 pos_top = target.offset().top - tooltip.outerHeight() - 20; 133 134 if (pos_left < 0) { 135 pos_left = target.offset().left + target.outerWidth() / 2 - 20; 136 tooltip.addClass('left'); 137 } 138 else 139 tooltip.removeClass('left'); 140 141 if (pos_left + tooltip.outerWidth() > $(window).width()) { 142 pos_left = target.offset().left - tooltip.outerWidth() + target.outerWidth() / 2 + 20; 143 tooltip.addClass('right'); 144 } 145 else 146 tooltip.removeClass('right'); 147 148 if (pos_top < 0) { 149 var pos_top = target.offset().top + target.outerHeight(); 150 tooltip.addClass('top'); 151 } 152 else 153 tooltip.removeClass('top'); 154 155 tooltip.css({ left: pos_left, top: pos_top }) 156 .animate({ top: '+=10', opacity: 1 }, 250); 157 }; 158 159 init_tooltip(); 160 $(window).resize(init_tooltip); 161 162 var remove_tooltip = function () { 163 tooltip.animate({ top: '-=10', opacity: 0 }, 50, function () { 164 $(this).remove(); 165 }); 166 167 target.attr('title', tip); 168 }; 169 170 target.bind('mouseleave', remove_tooltip); 171 target.bind('click', remove_tooltip); 172 tooltip.bind('click', remove_tooltip); 173 174 }); 175} 176/*----------------------------------------------------------------------------*/ 177 178//'Ajoute la fonction de Scroll vers une ancre à tous les lien href avec # 179function loadScrollToLink() { 180 $('a[href^="#"]').click(function () { 181 var id = $(this).attr("href"); 182 var offset = $(id).offset().top; 183 $('html, body').animate({ scrollTop: offset }, 'slow'); 184 return false; 185 }); 186} 187 188//'Scroll vers une ancre 189function scrollToLink(pLink = "") { 190 var id = document.getElementById(pLink); 191 var offset = $(id).offset().top - 50; 192 $('html, body').animate({ scrollTop: offset }, 'slow'); 193 return false; 194}
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.