$(document).ready(function() { // EMPÊCHER LES BALISES VIDES DE WORDPRESS $('p:empty').remove(); // EMPÊCHER LES BALISES VIDES AUTOUR DES IFRAME ET DES IMAGES $('body').find('iframe').unwrap(); $('.single-article__content').find('img').unwrap(); // AJOUTER UNE CLASSES AUX ITEMS DU SECOND MENU $(".grid__menu").children("a").addClass("grid__menu_item"); // RECHARGEMENT DE MASONRY AU CLICK var masonryUpdate = function() { setTimeout(function() { $('.grid__menu').masonry(); }); } $(document).on('click', masonryUpdate); $(".grid__menu_wrap").hide(); $(".header__nav").hide(); $(".grid__item_wrap-logo").click(function() { $(".grid__menu_wrap").fadeIn(); }); $("a[href$='#grid__menu_item__button-close']").click(function(){ $(".grid__menu_wrap").fadeOut(); }); // TUILE NEWS var $content = $(".grid__menu_item_news").html(); $("a[href$='#grid__menu_item__news'").html($content); $(".grid__menu_item_news__wrap_link").hover(function(){ $(".grid__menu_item_news_wrap_title-news").css('display','none'); $(".grid__menu_item_news__wrap_title").css('display','table-cell'); },function(){ $(".grid__menu_item_news__wrap_title").css('display','none'); $(".grid__menu_item_news_wrap_title-news").css('display','table-cell'); }); $(".header__title_button").click(function(){ $(".header__nav").fadeIn(); $("body").css("overflow","hidden"); }); $(".header__nav__row_button").click(function(){ $(".header__nav").fadeOut(); $("body").css("overflow","scroll"); }); $(".grid__item").hover(function() { $(this).children('.grid__item_overlay').stop().fadeTo(300, 0.95); }, function() { $(this).children('.grid__item_overlay').fadeTo(300, 0.5); }); $(".header__nav__column_right__item_news_title").hide(); $(".header__nav__column_right__item_news").hover(function(){ $(this).children('img').fadeTo(300, 0.1); $(this).children(".header__nav__column_right__item_news_title").fadeIn(); }, function() { $(this).children('img').fadeTo(300, 1); $(this).children(".header__nav__column_right__item_news_title").fadeOut(); }); // ANCRE TOP $(function() { $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 1000); return false; } } }); }); // INDEX LOGO RESPONSIVE if (window.matchMedia("screen and (max-width: 784px)").matches) { $('.grid__item_hidden').insertAfter('.grid > article:nth-child(2)'); $("a[href$='#grid__menu_item__button-close']").insertAfter('.grid__menu > a:nth-child(2)'); $('.header__title_button').html(''); } else { $('.grid__item_hidden').insertAfter('.grid > article:nth-child(5)'); } });