');
Bouton déroulant
$('.main-header .navigation li.dropdown .dropdown-btn').on('click', function() {
$(this).prev('ul').slideToggle(500) ;
});
Désactiver le lien parent déroulant
$('.navigation li.dropdown > a').on('clic', fonction(e) {
e.preventDefault() ;
});
}
Onglets de produits
if($('.project-tab').length){
$('.project-tab .product-tab-btns .p-tab-btn').on('clic', fonction(e) {
e.preventDefault() ;
var target = $($(this).attr('data-tab')) ;
if ($(target).hasClass('actve-tab')){
return false ;
}else{
$('.project-tab .product-tab-btns .p-tab-btn').removeClass('active-btn') ;
$(this).addClass('active-btn') ;
$('.project-tab .p-tabs-content .p-tab').removeClass('active-tab') ;
$(target).addClass('active-tab') ;
}
});
}
function checkScrolling(tabs){
var totalTabWidth = parseInt(tabs.children('.default-tabs-navigation').width(), 10),
tabsViewport = parseInt(tabs.width(), 10) ;
if( tabs.scrollLeft() >= totalTabWidth - tabsViewport) {
tabs.parent('.default-tabs').addClass('est-ended' ;
} sinon {
tabs.parent('.default-tabs').removeClass('est-terminé') ;
}
}
Carrousel de produits
if ($('.project-carrousel').length) {
$('.project-carrousel').owlCarrousel({
loop :true,
marge :30,
nav :true,
smartSpeed : 700,
lecture automatique : 5000,
navText : [ '', '' ],
réactif :{
0:{
Objets :1
},
600:{
Objets :2
},
800:{
Objets :2
},
1024:{
Objets :3
},
1200:{
Objets :4
},
1400:{
Objets :4
},
1600:{
Objets :4
}
}
});
}
Galerie avec filtres
if($('.filter-list').length){
$('.filter-list').mixItUp({}) ;
}
Jquery Spinner / Quantité Spinner
if($('.quantity-spinner').length){
$(« input.quantity-spinner »). TouchSpin({
verticalbuttons : vrai
});
}
Carrousel de témoignages de clients
if ($('.client-testimonial-carrousel').length & $('.client-thumbs-carrousel').length) {
var $sync 3 = $(« .client-testimonial-carrousel »),
$sync 4 = $(« .client-thumbs-carrousel »),
flag = false,
durée = 500 ;
$sync 3
.owlCarrousel({
loop :true,
objets : 1,
marge : 0,
NAV : Vrai,
navText : [ '', '' ],
points : false,
autoplay : true,
autoplayDélai d’attente : 5000
})
.on('changed.owl.carousel', fonction (e) {
if ( !drapeau) {
flag = faux ;
$sync 4.trigger('to.owl.carousel', [e.item.index, durée, true]) ;
flag = faux ;
}
});
$sync 4
.owlCarrousel({
loop :true,
marge :10,
objets : 1,
NAV : Faux,
navText : [ '', '' ],
points : false,
centre : faux,
autoplay : true,
autoplayDélai d’expiration : 5000,
Réactif : {
0:{
articles :1,
autoWidth : false
},
400:{
articles :1,
autoWidth : false
},
600:{
articles :1,
autoWidth : false
},
1000:{
articles :1,
autoWidth : false
},
1200:{
articles :1,
autoWidth : false
}
},
})
.on('clic', '.owl-item', fonction () {
$sync 3.trigger('to.owl.carousel', [$(this).index(), durée, true]) ;
})
.on('changed.owl.carousel', fonction (e) {
if ( !drapeau) {
flag = vrai ;
$sync 3.trigger('to.owl.carousel', [e.item.index, durée, true]) ;
flag = faux ;
}
});
}
Compteur de faits
fonction factCounter() {
if($('.fact-counter').length){
$('.fact-counter .counter-column.animated').each(function() {
var $t = $(ce),
n = $t.find(« .count-text »).attr(« arrêt-de-données »),
r = parseInt($t.find(« .count-text »).attr(« vitesse-de-données »), 10) ;
if ( !$t.hasClass(« compté »)) {
$t.addClass(« compté ») ;
$({
countNum : $t.find(« .count-text »).text()
}).animate({
countNum : n
}, {
durée : r,
l’assouplissement : « linéaire »,
étape : function() {
$t.find(« .count-text »).text(Math.floor(this.countNum)) ;
},
complet : function() {
$t.find(« .count-text »).text(this.countNum) ;
}
});
}
});
}
}
Compteur de faits + nombre de textes
if($('.count-box').length){
$('.count-box').appear(function(){
var $t = $(ce),
n = $t.find(« .count-text »).attr(« arrêt-de-données »),
r = parseInt($t.find(« .count-text »).attr(« vitesse-de-données »), 10) ;
if ( !$t.hasClass(« compté »)) {
$t.addClass(« compté ») ;
$({
countNum : $t.find(« .count-text »).text()
}).animate({
countNum : n
}, {
durée : r,
l’assouplissement : « linéaire »,
étape : function() {
$t.find(« .count-text »).text(Math.floor(this.countNum)) ;
},
complet : function() {
$t.find(« .count-text »).text(this.countNum) ;
}
});
}
},{accY : 0}) ;
}
Boîte Seclect Personnalisée
if($('.custom-select-box').length){
$('.custom-select-box').selectmenu().selectmenu('menuWidget').addClass('débordement') ;
}
Boîte d’onglets
if($('.tabs-box').length){
$('.tabs-box .tab-buttons .tab-btn').on('clic', function(e) {
e.preventDefault() ;
var target = $($(this).attr('data-tab')) ;
if ($(target).is(' :visible')){
return false ;
}else{
target.parents('.tabs-box').find('.tab-buttons').find('.tab-btn').removeClass('active-btn') ;
$(this).addClass('active-btn') ;
target.parents('.tabs-box').find('.tabs-content').find('.tab').fadeOut(0) ;
target.parents('.tabs-box').find('.tabs-content').find('.tab').removeClass('active-tab') ;
$(cible).fondu(300) ;
$(target).addClass('active-tab') ;
}
});
}
Carrousel d’articles uniques
if ($('..single-item-carrousel').length) {
$('.single-item-carrousel').owlCarrousel({
loop :true,
marge :0,
nav :true,
smartSpeed : 1000,
lecture automatique : 5000,
navText : [ '', '' ],
réactif :{
0:{
Objets :1
},
600:{
Objets :1
},
1200:{
Objets :1
}
}
});
}
Carrousel à deux articles
if ($('..two-item-carrousel').length) {
$('.carrousel-deux-éléments').hibouCarrousel({
loop :true,
marge :30,
nav :true,
smartSpeed : 700,
lecture automatique : 4000,
navText : [ '', '' ],
réactif :{
0:{
Objets :1
},
600:{
Objets :1
},
800:{
Objets :1
},
1024:{
Objets :2
},
1200:{
Objets :2
}
}
});
}
Carrousel à trois articles
if ($('..three-item-carrousel').length) {
$('.three-item-carrousel').owlCarrousel({
loop :true,
marge :30,
nav :true,
smartSpeed : 700,
lecture automatique : 5000,
navText : [ '', '' ],
réactif :{
0:{
Objets :1
},
600:{
Objets :1
},
800:{
Objets :2
},
1024:{
Objets :3
},
1200:{
Objets :3
},
}
});
}
Carrousel à quatre articles
if ($('..carrousel-de-quatre-éléments').length) {
$('.four-item-carrousel').owlCarrousel({
loop :true,
marge :30,
nav :true,
smartSpeed : 700,
lecture automatique : 4000,
navText : [ '', '' ],
réactif :{
0:{
Objets :1
},
600:{
Objets :2
},
800:{
Objets :2
},
1024:{
Objets :3
},
1200:{
Objets :4
}
}
});
}
Carrousel à quatre articles
if ($('..four-item-fluidcarousel').length) {
$('.four-item-fluidcarousel').owlCarrousel({
loop :true,
marge :0,
nav :true,
smartSpeed : 700,
lecture automatique : 4000,
navText : [ '', '' ],
réactif :{
0:{
Objets :1
},
800:{
Objets :2
},
1024:{
Objets :3
},
1500:{
Objets :4
}
}
});
}
carrousel de cinq articles
if ($('..five-item-carrousel').length) {
$('.five-item-carrousel').owlCarrousel({
loop :true,
marge :30,
nav :true,
smartSpeed : 700,
lecture automatique : 4000,
navText : [ '', '' ],
réactif :{
0:{
Objets :1
},
600:{
Objets :2
},
800:{
Objets :3
},
1024:{
Objets :4
},
1200:{
Objets :5
}
}
});
}
carrousel de six articles
if ($('.six-item-carousel').length) {
$('.six-item-carrousel').owlCarrousel({
loop :true,
marge :30,
nav :true,
smartSpeed : 700,
lecture automatique : 4000,
navText : [ '', '' ],
réactif :{
0:{
Objets :1
},
480:{
Objets :2
},
767:{
Objets :3
},
900:{
Objets :4
},
1024:{
Objets :5
},
1200:{
Objets :6
}
}
});
}
Maçonnerie
function enableMasonry() {
if($('.masonry-items-container').length){
var winDow = $(fenêtre) ;
Variables nécessaires
var $container=$('.masonry-items-container') ;
$container.isotope({
itemSelector : '.masonry-item',
Maçonnerie : {
columnLargeur : 0
},
animationOptions :{
durée :500,
Assouplissement :'Linéaire'
}
});
winDow.bind('redimensionner', function(){
$container.isotope({
itemSelector : '.masonry-item',
animationOptions : {
durée : 500,
assouplissement : 'linéaire',
file d’attente : false
}
});
});
}
}
enableMasonry() ;
style isotopique
if ($('.isotope_block').longueur) {
$('.isotope_block').isotope({
layoutMode :'maçonnerie'
});
}
Curseur de gamme de prix
if($('.range-slider-price').length){
var priceRange = document.getElementById('range-slider-price') ;
noUiSlider.create(priceRange, {
Début : [ 180, 560 ],
limite : 1000,
comportement : « glisser »,
connect : true,
Portée : {
'min' : 100,
'max' : 1000
}
});
var limitFieldMin = document.getElementById('min-value-rangeslider') ;
var limitFieldMax = document.getElementById('max-value-rangeslider') ;
priceRange.noUiSlider.on('update', function( values, handle ){
(handle ? limitFieldMax : limitFieldMin).value = values[handle] ;
});
}
Boîte accordéon
if($('.accordion-box').length){
$(« .accordion-box »).on('clic', '.accord-btn', function() {
if($(this).hasClass('active') !==true){
$('.accordion .accord-btn').removeClass('active') ;
}
if ($(this).next('.accord-content').is(' :visible')){
$(this).removeClass('active') ;
$(this).next('.accord-content').slideUp(300) ;
}else{
$(this).addClass('actif') ;
$('.accordion .accord-content').slideUp(300) ;
$(this).next('.accord-content').slideDown(300) ;
}
});
}
LightBox / Fancybox
if($('.lightbox-image').length) {
$('.lightbox-image').fancybox({
openEffect : 'fondu',
closeEffect : 'fondu',
Aides : {
Médias : {}
}
});
}
Barre de progression / Niveaux
if($('.progress-levels .progress-box .bar-fill').length){
$(« .progress-box .bar-fill »).each(function() {
var progressWidth = $(this).attr('pour-cent-de-données') ;
$(this).css('width',progressWidth+' %') ;
$(this).children('.percent').html(progressWidth+' %') ;
});
}
Validation du formulaire de contact
if($('#contact-formulaire').longueur){
$(« #contact-forme »).valider({
submitHandler : function(form) {
var form_btn = $(form).find('button[type="submit"]') ;
var form_result_div = '#form-résultat' ;
$(form_result_div).supprimer() ;
form_btn.avant('');
var form_btn_old_msg = form_btn.html() ;
form_btn.html(form_btn.prop('disabled', true).data(« loading-text »)) ;
$(form).ajaxSubmit({
dataType : 'json',
success : function(data) {
if( data.status == 'true' ) {
$(form).find('.form-control').val('') ;
}
form_btn.prop('disabled', false).html(form_btn_old_msg) ;
$(form_result_div).html(data.message).fadeIn('lent') ;
setTimeout(function(){ $(form_result_div).fadeOut('slow') }, 6000) ;
}
});
}
});
}
if ($('.time-countdown').length) {
$('.time-countdown').each(function () {
var Self = $(this) ;
var countDate = Self.data('countdown-time') ; Date d’obtention
Self.countdown(countDate, function(event) {
$(this).html(''+ event.strftime(' %D : %H : %M : %S') +'
');
});
});
};
if ($('.time-countdown-two').length) {
$('.time-countdown-two').each(function () {
var Self = $(this) ;
var countDate = Self.data('countdown-time') ; Date d’obtention
Self.countdown(countDate, function(event) {
$(this).html(' '+ event.strftime(' %D') +' Jours
'+ event.strftime(' %H') +' Heures
'+ event.strftime(' %M') +' compte-rendu
'+ event.strftime(' %S') +' Secondes
');
});
});
};
Sélecteur de langue
if ($(« options-#polyglot-langue »).length) {
$('#polyglotLanguageSwitcher').polyglotLanguageSwitcher({
effet : 'glisser',
animVitesse : 150,
testMode : true,
onChange : function(evt) {
alert(« La langue sélectionnée est : " + evt.selectedItem) ;
}
});
};
Animation d’éléments
if($('.wow').length){
var wow = nouveau WOW(
{
boxClass : 'wow', // classe css d’élément animé (par défaut wow)
animateClass : 'animated', // classe css d’animation (animée par défaut)
Décalage : 0, // distance à l’élément lors du déclenchement de l’animation (la valeur par défaut est 0)
mobile : false, // déclenche des animations sur les appareils mobiles (true par défaut)
live : true // agir sur le contenu chargé de manière asynchrone (true par défaut)
}
);
wow.init() ;
}
/* ==========================================================================
Lorsque le document défile, faites
========================================================================== */
$(window).on('défilement', function() {
headerStyle() ;
factCounter() ;
});
/* ==========================================================================
Lorsque le document est chargé, faites
========================================================================== */
$(window).on('charger', function() {
handlePreloader() ;
});
})(window.jQuery) ;