$(document).ready(function(){
// Menu language
$('.js-choice-languages').click(function(){
var parent = $(this).parent();
if(parent.hasClass('opened')){
parent.removeClass('opened');
parent.find('ul').hide('fast');
}else{
parent.addClass('opened');
parent.find('ul').show('fast');
}
return false;
});
//markets
var img = $(".market_bloc.active").data('img');
var title = $(".market_bloc.active").data('title');
var link = $(".market_bloc.active").data('link');
var excerpt = $(".market_bloc.active").data('excerpt');
$(".market_description img").attr("src", img);
$(".market_description h3").text(title);
$(".market_description p").html(excerpt);
$(".market_description a").attr("href", link);
$( ".market_bloc" ).click(function() {
$(".market_bloc").removeClass('active');
$(this).addClass('active');
var img = $(this).data('img');
var title = $(this).data('title');
var link = $(this).data('link');
var excerpt = $(this).data('excerpt');
$('.market_description').animate({'opacity': 0}, 0, function () {
$(".market_description img").attr("src", img);
$(".market_description h3").text(title);
$(".market_description p").html(excerpt);
$(".market_description a").attr("href", link);
}).animate({'opacity': 1}, 0);
//return false;
});
var mq = window.matchMedia("screen and (min-width: 992px)");
if(mq.matches){
$( ".market_bloc" ).click(function() {
return false;
});
}else{
// console.log('< 991');
}
});
//numbers scroll & animation
var a = 0;
$(window).scroll(function() {
var $nb_container = $('#nb_container');
if($nb_container.length!=1){
return;
}
var oTop = $('#nb_container').offset().top - window.innerHeight;
if (a == 0 && $(window).scrollTop() > oTop) {
$('.counter').each(function() {
var $this = $(this),
countTo = $this.attr('data-count');
$({
countNum: $this.text()
}).animate({
countNum: countTo
},
{
duration: 4500,
easing: 'swing',
step: function() {
$this.text(Math.floor(this.countNum));
},
complete: function() {
$this.text(this.countNum);
}
});
});
a = 1;
}
});
$('.bxslider').bxSlider({
auto: ($(".bxslider .item").length > 1) ? true: false,
mode: 'fade',
pager: false,
controls: false,
pause:6000,
});
$('.bxslider_stories').bxSlider({
auto: false,
pager: false,
controls: true,
slideMargin: 15,
minSlides: 1,
maxSlides: 3,
infiniteLoop: false,
slideWidth: 320,
moveSlides:1,
shrinkItems: false,
pause:6000,
nextSelector: '.custom_controls .custom_next',
prevSelector: '.custom_controls .custom_prev',
nextText: '',
prevText: '',
onSliderLoad: function() {
$(".bxslider_stories .item").eq(1).addClass('active-slide');
},
onSlideBefore: function($slideElement, oldIndex, newIndex) {
$(".bxslider_stories .item").removeClass('active-slide');
$(".bxslider_stories .item").eq(newIndex+1).addClass('active-slide');
},
onSlideNext: function($slideElement, oldIndex, newIndex) {
$(".bxslider_stories .item").removeClass('current');
current = $('.bxslider_stories').eq(newIndex);
//console.log(current);
//$(".bxslider_stories .item:not(.bx-clone)").eq(current).addClass('current');
},
});
$('.bxslider_news').bxSlider({
auto: true,
pager: true,
mode: 'fade',
controls:false,
pause:6000,
});
$(document).ready(function(){
$('.line').each(function(index) {
//console.log( index );
height_txt = $(this).find('.post_content').height();
height_img = $(this).find('.post_img img').height();
// console.log(height_txt,height_img);
if(height_img!=0){
if(height_img==height_txt){
$(this).find('.post_content').addClass('smaller');
}
if(height_img menu_pos) {
$('.header').addClass('smaller');
} else {
$('.header').removeClass('smaller');
}
//si scroll vers le bas, on cache le menu. Si scroll vers le haut on l'affiche.
}
window.onload = function() {
navbar();
window.addEventListener('scroll', navbar);
}
});
new WOW().init();
$('#partnerModal').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget) // Button that triggered the modal
var img = button.data('img');
var title = button.data('title');
var txt = button.data('txt');
var website = button.data('website');
// console.log(website);
var modal = $(this)
modal.find('#partnerModal_logo').attr("src",img);
modal.find('#partnerModal_txt').html(txt);
if(website!=''){
modal.find('#partnerModal_website').attr("href",website);
modal.find('#partnerModal_website').removeClass('hidden');
}else{
modal.find('#partnerModal_website').addClass('hidden');
}
});
function autoType(elementClass, typingSpeed){
var thhis = $(elementClass);
thhis.css({
"position": "relative",
"display": "inline-block"
});
thhis.prepend('');
thhis = thhis.find(".text-js");
var text = thhis.text().trim().split('');
var amntOfChars = text.length;
var newString = "";
thhis.text("|");
setTimeout(function(){
thhis.css("opacity",1);
thhis.prev().removeAttr("style");
thhis.text("");
for(var i = 0; i < amntOfChars; i++){
(function(i,char){
setTimeout(function() {
newString += char;
thhis.text(newString);
},i*typingSpeed);
})(i+1,text[i]);
}
},1500);
}
$(document).ready(function(){
// Now to start autoTyping just call the autoType function with the
// class of outer div
// The second paramter is the speed between each letter is typed.
autoType(".type-js",600);
});
//Forms
document.addEventListener( 'wpcf7mailsent', function( event ) {
if ( '7944' == event.detail.contactFormId ) {
dataLayer.push({'event': 'Hotline'});
}
if ( '8460' == event.detail.contactFormId ) {
dataLayer.push({'event': 'Apply'});
}
if ( '6892' == event.detail.contactFormId ) {
dataLayer.push({'event': 'Privacy'});
}
if ( '9396' == event.detail.contactFormId ) {
dataLayer.push({'event': 'Jobs'});
}
}, false );
$(document).ready(function(){
var arch = "32";
var linkOS = "Win";
var extension = "exe";
if (navigator.userAgent.indexOf("Win") != -1) {
linkOS = "Win";
}
if (navigator.userAgent.indexOf("Linux") != -1) {
linkOS = "Linux";
extension = "zip";
}
if (navigator.userAgent.indexOf("WOW64") != -1 ||
navigator.userAgent.indexOf("Win64") != -1 ||
navigator.userAgent.indexOf("x86_64") != -1) {
arch = "64";
}
linkOS = linkOS + arch;
if (navigator.userAgent.indexOf("Mac") != -1) {
linkOS = "MacOS";
extension = "zip";
}
$('.js-special-download-btn').each(function () {
var directory = $(this).attr('data-directory');
var basename = $(this).attr('data-basename');
var version = $(this).attr('data-version');
// var extension = $(this).attr('data-extension');
var url = directory + '/' + basename + '-' + linkOS + '-' + version + '.' + extension;
$(this).attr('href', url);
});
// // var version = "19.05";
// // var extension = "zip";
// //
// // var linkPrefix = "packages/SDK/" + version + "//MicroEJ-SDK-Installer-";
//
//
// var linkSuffix = "-" + version + "." + extension;
//
// var linkContent = linkPrefix + linkOS + linkSuffix;
// $('.js-special-download-btn').click(function (e) {
// e.preventDefault();
//
// });
});
var section = $('.accordion li');
var sliderDots = $('.slider-dot'); // Sélection des dots
var autoSlideInterval; // Intervalle pour le changement automatique
var currentIndex = 0; // Index du slide actuel
function toggleAccordion(index) {
section.removeClass('active'); // Supprime la classe active de toutes les sections
sliderDots.removeClass('active');
section.eq(index).addClass('active'); // Active la section correspondant à l'index passé
sliderDots.eq(index).addClass('active');
currentIndex = index; // Met à jour l'index actuel
}
// Fonction pour démarrer l'auto-slide toutes les 5 secondes
function startAutoSlide() {
autoSlideInterval = setInterval(function() {
var nextIndex = (currentIndex + 1) % section.length; // Passe à la prochaine section
toggleAccordion(nextIndex);
}, 5000); // Défilement automatique toutes les 5 secondes
}
// Fonction pour arrêter l'auto-slide
function stopAutoSlide() {
clearInterval(autoSlideInterval);
}
// Survol des sections (arrêter l'auto-slide au hover)
section.on('mouseover', function() {
stopAutoSlide(); // Arrêter le défilement automatique lors du survol
var index = $(this).index(); // Récupérer l'index de la section survolée
toggleAccordion(index); // Activer la section correspondante
});
// Clic sur les dots (arrêter l'auto-slide au clic)
sliderDots.on('click', function(e) {
stopAutoSlide(); // Arrêter le défilement automatique lors du clic sur un dot
e.stopPropagation(); // Empêche la propagation de l'événement
var index = $(this).data('index'); // Récupérer l'index du dot cliqué
toggleAccordion(index); // Activer la section correspondante
});
// Démarrer l'auto-slide lorsque la page est prête
$(document).ready(function() {
toggleAccordion(0); // Afficher la première section par défaut
startAutoSlide(); // Démarrer l'auto-slide
});