(function($) { "use strict" /* //disclaimer cookies var css_disclaimer_cookie = ' style="display:none; position:fixed; bottom:0; left:0; width:100%; padding:40px 10px; z-index:99999999; background:#333; color:#fff; font-size:16px;" '; var css_disclaimer_cookie_button_ok = ' style="display:inline-block; padding: 20px; margin-left:30px; background:#fff; color:#000; font-size:16px;" '; var css_disclaimer_cookie_link_normal = ' style="color:#fff; font-size:16px; text-decoration:underline;" '; if (getCookie('WG_disclaimer_cookies') == '') { $("body").append( '' ); $(".disclaimer_cookie").show(); } */ /* $(".liensOnepage").on("click", function() { var el = $(this).attr('href'); var height = $(el)[0].offsetTop - 120; $('html, body').animate({ scrollTop: height }, 800); if ($('.navbar-toggle').css('display') != 'none') { if (!$('.navbar-toggle').hasClass('collapsed')) { $('.navbar-toggle').trigger("click"); } } }); */ //Page Preloader $(window).load(function() { if (window.location.pathname.includes("actualite-du-mois")) { $('#menu-main li:nth-child(7)').addClass("active") } $("#intro").delay(300).fadeOut(); $(".animationload").delay(600).fadeOut("slow"); }); // FitDiv $("body").fitVids(); // Tooltips // $('.social, .media_element, .bs-example-tooltips').tooltip({ // selector: "[data-toggle=tooltip]", // container: "body" // }) // DM Menu jQuery('.header').affix({ offset: { top: $('.header').offset().top } }); // Menu drop down effect $('.dropdown-toggle').dropdownHover().dropdown(); $(document).on('click', '.fhmm .dropdown-menu', function(e) { e.stopPropagation() }) //pretty photo jQuery(document).ready(function(){ jQuery("a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',theme:'dark_rounded',slideshow:false,overlay_gallery: false,social_tools:false,deeplinking:false}); }); // Fun Facts function count($this){ var current = parseInt($this.html(), 10); current = current + 1; /* Where 50 is increment */ $this.html(++current); if(current > $this.data('count')){ $this.html($this.data('count')); } else { setTimeout(function(){count($this)}, 50); } } $(".stat-count").each(function() { $(this).data('count', parseInt($(this).html(), 10)); $(this).html('0'); count($(this)); }); //Parallax $(window).bind('load', function() { parallaxInit(); }); function parallaxInit() { $('#one-parallax').parallax("30%", 0.1); $('#two-parallax').parallax("30%", 0.1); $('#three-parallax').parallax("30%", 0.1); $('#four-parallax').parallax("30%", 0.1); } // Search var $ctsearch = $( '#dmsearch' ), $ctsearchinput = $ctsearch.find('input.dmsearch-input'), $body = $('html,body'), openSearch = function() { $ctsearch.data('open',true).addClass('dmsearch-open'); $ctsearchinput.focus(); return false; }, closeSearch = function() { $ctsearch.data('open',false).removeClass('dmsearch-open'); }; $ctsearchinput.on('click',function(e) { e.stopPropagation(); $ctsearch.data('open',true); }); $ctsearch.on('click',function(e) { e.stopPropagation(); if( !$ctsearch.data('open') ) { openSearch(); $body.off( 'click' ).on( 'click', function(e) { closeSearch(); } ); } else { if( $ctsearchinput.val() === '' ) { closeSearch(); return false; } } }); // Selector $(window).on('load', function () { $('.selectpicker').selectpicker({ 'selectedText': 'cat' }); }); // Back to Top jQuery(window).scroll(function(){ if (jQuery(this).scrollTop() > 1) { jQuery('.dmtop').css({bottom:"25px"}); } else { jQuery('.dmtop').css({bottom:"-100px"}); } }); jQuery('.dmtop').click(function(){ jQuery('html, body').animate({scrollTop: '0px'}, 800); return false; }); })(jQuery);