jQuery.noConflict()(function ($){
"use strict";
var $window=window,
offset='90%',
$doc=$(document),
$html=$('html'),
self=this,
$body=$('body'),
TweenMax=window.TweenMax,
fl_theme=window.fl_theme||{};
fl_theme.window=$(window);
fl_theme.document=$(document);
window.fl_theme=fl_theme;
fl_theme.window=$(window);
fl_theme.sameOrigin=true;
fl_theme.initEventsCustom=function (){
fl_theme.window.load(function (){
if(fl_theme.sameOrigin&&typeof parent.vc!='undefined'&&typeof parent.vc.events!='undefined'){
parent.vc.events.on('shortcodeView:ready', function (){
$('body').trigger('post-load');
});
}});
};
function handlePageReady(){
$html.addClass('dom-ready');
}
$(window).on('load', handlePageReady);
setTimeout(handlePageReady, 5000);
fl_theme.initStikySidebar=function (){
var sidebar_stiky=$('.sidebar-sticky');
if(sidebar_stiky.length){
sidebar_stiky.theiaStickySidebar({
additionalMarginTop: 30,
additionalMarginBottom: 30
});
}};
fl_theme.initResponsiveIframe=function (){
var resizeitem=$('iframe');
resizeitem.height(resizeitem.attr("height") / resizeitem.attr("width") * resizeitem.width()
);
};
fl_theme.initImagePopup=function (){
$('.fl-gallery-image-popup').magnificPopup({
delegate: 'a',
type: 'image',
removalDelay: 500,
image: {
markup: '<div class="mfp-figure">' +
'<div class="mfp-img"></div>' +
'<div class="mfp-bottom-bar">' +
'<div class="mfp-title"></div>' +
'</div>' +
'</div>' +
'<div class="mfp-close"></div>' +
'<div class="mfp-counter"></div>'
},
callbacks: {
beforeOpen: function (){
this.st.image.markup=this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
this.st.mainClass='fl-zoom-in-popup-animation';
}},
closeOnContentClick: true,
midClick: true,
gallery: {
enabled: true,
arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%">' +
'<svg viewBox="0 0 40 40">' +
'<path d="M10,20 L30,20 M22,12 L30,20 L22,28"></path>' +
'</svg>' +
'</button>',
tPrev: 'Previous',
tNext: 'Next',
tCounter: '<span class="mfp-counter">%curr% of %total%</span>'
}});
};
fl_theme.initGalleryPopup=function (){
$('.fl-magic-popup').each(function (){
var popup_gallery_custom_class=$(this).attr('data-custom-class'),
gallery_enable=true,
popup_type='image';
if($(this).hasClass('fl-single-popup')){
gallery_enable=false;
popup_gallery_custom_class='fl-single-popup';
}else if($(this).hasClass('fl-video-popup')){
popup_type='iframe';
gallery_enable=false;
popup_gallery_custom_class='fl-video-popup';
}
$("." + popup_gallery_custom_class).magnificPopup({
delegate: 'a',
type: popup_type,
gallery: {
enabled: gallery_enable,
tPrev: 'Previous',
tNext: 'Next',
tCounter: '<span class="mfp-counter">%curr% / %total%</span>'
},
image: {
markup: '<div class="mfp-figure">' +
'<div class="mfp-img"></div>' +
'</div>' +
'<div class="mfp-close"></div>' +
'<div class="mfp-bottom-bar">' +
'<div class="mfp-title"></div>' +
'<div class="mfp-counter"></div>' +
'</div>'
},
iframe: {
markup: '<div class="mfp-iframe-scaler">' +
'<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>' +
'</div>' +
'<div class="mfp-close"></div>'
},
mainClass: 'mfp-zoom-in',
removalDelay: 300,
callbacks: {
open: function (){
$.magnificPopup.instance.next=function (){
var self=this;
self.wrap.removeClass('mfp-image-loaded');
setTimeout(function (){
$.magnificPopup.proto.next.call(self);
}, 120);
};
$.magnificPopup.instance.prev=function (){
var self=this;
self.wrap.removeClass('mfp-image-loaded');
setTimeout(function (){
$.magnificPopup.proto.prev.call(self);
}, 120);
}},
imageLoadComplete: function (){
var self=this;
setTimeout(function (){
self.wrap.addClass('mfp-image-loaded');
}, 16);
}}
});
});
};
fl_theme.initCustomSelect=function (){
var jelect=$('.jelect');
if(jelect.length){
jelect.jelect();
}};
fl_theme.initIsotopeCustomFunction=function (){
var $grid=$('.fl-isotope-wrapper');
$grid.isotope({
itemSelector: '.fl-grid-item',
isAnimated: true,
percentPosition: true,
masonry: {
columnWidth: '.fl-grid-item'
}});
$grid.imagesLoaded().progress(function (){
$grid.isotope('layout');
});
};
fl_theme.initHeaderSearchForm=function (){
var $SearchForm=$('.header-search-form'),
OpenSearchForm=void 0,
search_form=$('form.search_global'),
$searchformicon=$('.header-search');
self.toggleFullscreenSearchForm=function (){
self[OpenSearchForm ? 'closeFullscreenSearchForm':'openFullscreenSearchForm']();
};
self.openFullscreenSearchForm=function (){
if(OpenSearchForm||!$SearchForm.length){
return;
}
OpenSearchForm=1;
TweenMax.set($SearchForm, {
opacity: 0,
force3D: true
});
TweenMax.set(search_form, {
opacity: 0,
y: '-100%',
force3D: true
});
$searchformicon.addClass('opened');
$searchformicon.removeClass('closed');
TweenMax.to($SearchForm, 0.4, {
opacity: 1,
display: 'block'
});
TweenMax.to(search_form, 0.5, {
opacity: 1,
y: '0%',
delay: 0.4
});
$SearchForm.addClass('open');
$('body').addClass('stop-scrolling');
};
self.closeFullscreenSearchForm=function (){
if(!OpenSearchForm||!$SearchForm.length){
return;
}
OpenSearchForm=0;
$searchformicon.removeClass('opened');
$searchformicon.addClass('closed');
TweenMax.to(search_form, 0.4, {
opacity: 0,
y: '-100%'
});
TweenMax.to($SearchForm, 0.4, {
force3D: true,
display: 'none',
delay: 0.4
});
$SearchForm.removeClass('open');
$('body').removeClass('stop-scrolling');
};
$doc.on('click', '.header-search', function (e){
self.toggleFullscreenSearchForm();
e.preventDefault();
});
};
fl_theme.initNavBarFixed=function (){
var c, currentScrollTop=0;
var body=$('body'),
nav_bar=$('.fl--header'),
nav_bar_height=nav_bar.height();
if(nav_bar.hasClass("fixed-navbar")){
body.find('.header-padding').css("padding-top", nav_bar_height + "px");
$(window).scroll(function (){
var a=$(window).scrollTop();
var b=nav_bar.height();
var d=nav_bar.find('.fl-top-header-content').height();
currentScrollTop=a;
if(nav_bar.hasClass("auto-hide-navbar")){
if(c < currentScrollTop&&a > b + 500){
nav_bar.addClass("scrollUp");
}else if(c > currentScrollTop&&!(a <=b)){
nav_bar.removeClass("scrollUp");
}}
if(c < currentScrollTop&&a > b){
nav_bar.addClass("fixed-enable");
}else if(c > currentScrollTop&&a < d){
nav_bar.removeClass("fixed-enable");
}
c=currentScrollTop;
});
}};
fl_theme.initCarsSlider=function (){
$('.auto-slider .slides').slick({
dots: false,
infinite: false,
speed: 500,
slidesToShow: 1,
slidesToScroll: 1,
draggable: true,
focusOnSelect: true,
nextArrow: '.fl-slider-arrow-right',
prevArrow: '.fl-slider-arrow-left',
asNavFor: '.auto-carousel .slides'
});
$('.auto-carousel .slides').slick({
dots: false,
infinite: false,
draggable: true,
speed: 500,
slidesToShow: 5,
slidesToScroll: 1,
focusOnSelect: true,
arrows: false,
swipeToSlide: true,
asNavFor: '.auto-slider .slides',
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 3,
slidesToScroll: 1
}},
{
breakpoint: 600,
settings: {
slidesToShow: 2,
slidesToScroll: 1
}},
{
breakpoint: 480,
settings: {
slidesToShow: 2,
slidesToScroll: 1
}}
]
});
};
fl_theme.initCustomTabs=function (){
var $tabs=$('.wrap-nav-table-content');
$tabs.on('click', 'li', function (){
var tab_id=$(this).attr('data-tab'),
$tabs_content=$('.tab-content'),
$tabs_clicked=$("#" + tab_id);
$tabs.find('li').removeClass('active');
$(this).addClass('active');
$tabs_content.removeClass('active');
$tabs_clicked.addClass('active');
});
};
fl_theme.initCarGoogleMaps=function (){
var car_maps=$('#contact-map'),
lat=car_maps.attr('data-location-lat'),
long=car_maps.attr('data-location-long');
if(car_maps.length){
car_maps.gmap3({
marker: {
options: {
position: [lat, long],
}},
map: {
options: {
center: [lat, long],
zoom: 11,
scrollwheel: false,
draggable: true,
mapTypeControl: true,
styles: [{
"featureType": "administrative",
"elementType": "all",
"stylers": [{
"visibility": "on"
}, {
"saturation": -100
}, {
"lightness": 20
}]
}, {
"featureType": "road",
"elementType": "all",
"stylers": [{
"visibility": "on"
}, {
"saturation": -100
}, {
"lightness": 40
}]
}, {
"featureType": "water",
"elementType": "all",
"stylers": [{
"visibility": "on"
}, {
"saturation": -10
}, {
"lightness": 30
}]
}, {
"featureType": "landscape.man_made",
"elementType": "all",
"stylers": [{
"visibility": "simplified"
}, {
"saturation": -60
}, {
"lightness": 10
}]
}, {
"featureType": "landscape.natural",
"elementType": "all",
"stylers": [{
"visibility": "simplified"
}, {
"saturation": -60
}, {
"lightness": 60
}]
}, {
"featureType": "poi",
"elementType": "all",
"stylers": [{
"visibility": "off"
}, {
"saturation": -100
}, {
"lightness": 60
}]
}, {
"featureType": "transit",
"elementType": "all",
"stylers": [{
"visibility": "off"
}, {
"saturation": -100
}, {
"lightness": 60
}]
}]
}}
});
}};
fl_theme.initGridSwitchCar=function (){
if($('#pixad-listing').hasClass('grid')){
$('.sorting__item.view-by .grid').addClass('active')
}else{
$('.sorting__item.view-by .list').addClass('active')
}};
fl_theme.initCustomWidgetRange=function (){
if($('#slider-price').length > 0){
var slider=document.getElementById('slider-price');
var min_price=document.getElementById('pix-min-price').value;
var max_price=document.getElementById('pix-max-price').value;
var max_slider_price=document.getElementById('pix-max-slider-price').value;
var pix_thousand=document.getElementById('pix-thousand').value;
var pix_decimal=document.getElementById('pix-decimal').value;
var pix_decimal_number=document.getElementById('pix-decimal_number').value;
min_price=min_price=='' ? 0:min_price;
max_price=max_price=='' ? max_slider_price:max_price;
noUiSlider.create(slider, {
start: [min_price, max_price],
step: 1000,
connect: true,
range: {
'min': 0,
'max': Number(max_slider_price)
},
format: wNumb({
decimals: pix_decimal_number,
mark: pix_decimal,
thousand: pix_thousand
})
});
var pValues_price=[
document.getElementById('slider-price_min'),
document.getElementById('slider-price_max')
];
slider.noUiSlider.on('update', function (values, handle){
pValues_price[handle].value=values[handle];
});
slider.noUiSlider.on('change', function (values, handle){
$(pValues_price[handle]).trigger('change');
});
}
if($('#slider-year').length > 0){
var slider_year=document.getElementById('slider-year');
var min_year=document.getElementById('pix-min-year').value;
var max_year=document.getElementById('pix-max-year').value;
var max_slider_year=document.getElementById('pix-max-slider-year').value;
min_year=min_year=='' ? 1950:min_year;
max_year=max_year=='' ? max_slider_year:max_year;
noUiSlider.create(slider_year, {
start: [min_year, max_year],
step: 1,
connect: true,
range: {
'min': 1950,
'max': Number(max_slider_year)
},
format: {
to: function (value){
return value;
},
from: function (value){
return value;
}}
});
var pValues_year=[
document.getElementById('slider-year_min'),
document.getElementById('slider-year_max')
];
slider_year.noUiSlider.on('update', function (values, handle){
pValues_year[handle].value=values[handle];
});
slider_year.noUiSlider.on('change', function (values, handle){
$(pValues_year[handle]).trigger('change');
});
}
if($('#slider-radius').length > 0){
var slider_radius=document.getElementById('slider-radius');
var min_slider_radius=document.getElementById('pix-min-radius').value;
var max_slider_radius=document.getElementById('pix-max-radius').value;
noUiSlider.create(slider_radius, {
start: [0],
step: 1,
connect: 'upper',
range: {
'min': parseInt(min_slider_radius),
'max': Number(max_slider_radius)
},
direction: 'ltr',
handler: 'ltr'
});
var pValue_radius=[
document.getElementById('car-locator-radius')
];
var pValue_radius_show=[
document.getElementById('pixba_radius_max')
];
slider_radius.noUiSlider.on('update', function (values, handle){
pValue_radius[handle].value=values[handle];
pValue_radius_show[handle].value=values[handle];
});
slider_radius.noUiSlider.on('change', function (values, handle){
$(pValue_radius[handle]).trigger('change');
$(pValue_radius_show[handle]).trigger('change');
});
}
if($('#slider-mileage').length > 0){
var slider_mileage=document.getElementById('slider-mileage');
var min_mileage=document.getElementById('pix-min-mileage').value;
var max_mileage=document.getElementById('pix-max-mileage').value;
var max_slider_mileage=document.getElementById('pix-max-slider-mileage').value;
min_mileage=min_mileage=='' ? 0:min_mileage;
max_mileage=max_mileage=='' ? max_slider_mileage:max_mileage;
noUiSlider.create(slider_mileage, {
start: [min_mileage, max_mileage],
step: 10000,
connect: true,
range: {
'min': 0,
'max': Number(max_slider_mileage)
},
format: {
to: function (value){
return value;
},
from: function (value){
return value;
}}
});
var pValues_mileage=[
document.getElementById('slider-mileage_min'),
document.getElementById('slider-mileage_max')
];
slider_mileage.noUiSlider.on('update', function (values, handle){
pValues_mileage[handle].value=values[handle];
});
slider_mileage.noUiSlider.on('change', function (values, handle){
$(pValues_mileage[handle]).trigger('change');
});
}
if($('#slider-engine').length > 0){
var slider_engine=document.getElementById('slider-engine');
var min_engine=document.getElementById('pix-min-engine').value;
var max_engine=document.getElementById('pix-max-engine').value;
var max_slider_engine=document.getElementById('pix-max-slider-engine').value;
min_engine=min_engine=='' ? 0:min_engine;
max_engine=max_engine=='' ? max_slider_engine:max_engine;
noUiSlider.create(slider_engine, {
start: [min_engine, max_engine],
step: 0.1,
connect: true,
range: {
'min': 0,
'max': Number(max_slider_engine)
},
});
var pValues_engine=[
document.getElementById('slider-engine_min'),
document.getElementById('slider-engine_max')
];
slider_engine.noUiSlider.on('update', function (values, handle){
pValues_engine[handle].value=values[handle];
});
slider_engine.noUiSlider.on('change', function (values, handle){
$(pValues_engine[handle]).trigger('change');
});
}};
fl_theme.initCustomHeidthIframeSlider=function (){
var slider_iframe=$('.car-details .auto-slider .slides li iframe'),
slider_iframe_parent=$('.car-details .auto-slider .slides li').height();
if(slider_iframe.length){
slider_iframe.css({
'height': '' + slider_iframe_parent + 'px'
});
}};
fl_theme.initCustomWidgetFunction=function (){
$('.widget.widget_categories .children').parent('.cat-item').addClass('has-sub-category');
};
fl_theme.initLoginFormOptionFunction=function (){
var $loginForm=$('.login-form');
var OpenLoginForm=void 0;
var login_form=$('.fl-login_form');
var $header_login_icon=$('.header-login');
self.toggleLoginForm=function (){
self[OpenLoginForm ? 'closeHeaderLoginForm':'openHeaderLoginForm']();
};
self.openHeaderLoginForm=function (){
if(OpenLoginForm||!$loginForm.length){
return;
}
OpenLoginForm=1;
TweenMax.set($loginForm, {
opacity: 0,
force3D: true
});
TweenMax.set(login_form, {
opacity: 0,
y: '-100%',
force3D: true
});
$header_login_icon.addClass('opened');
$header_login_icon.removeClass('closed');
TweenMax.to($loginForm, 0.4, {
opacity: 1,
display: 'block'
});
TweenMax.to(login_form, 0.5, {
opacity: 1,
y: '0%',
delay: 0.4
});
$loginForm.addClass('open');
$('body').addClass('stop-scrolling');
};
self.closeHeaderLoginForm=function (){
if(!OpenLoginForm||!$loginForm.length){
return;
}
OpenLoginForm=0;
$header_login_icon.removeClass('opened');
$header_login_icon.addClass('closed');
TweenMax.to(login_form, 0.4, {
opacity: 0,
y: '-100%'
});
TweenMax.to($loginForm, 0.4, {
force3D: true,
display: 'none',
delay: 0.4
});
$loginForm.removeClass('open');
$('body').removeClass('stop-scrolling');
};
$doc.on('click', '.header-login .fl-flipper-icon', function (e){
self.toggleLoginForm();
e.preventDefault();
});
};
fl_theme.initMobileNavigationOpenClose=function (){
var $navbar_wrapper=$('.fl-mobile-menu-wrapper'),
$navbar_menu_sidebar=$('.fl--mobile-menu-navigation-wrapper'),
$hamburgerbars=$('.fl--hamburger-menu-wrapper,.fl--hamburger-menu'),
$social_profiles=$('.fl-mobile-menu-wrapper ul.fl-sidebar-social-profiles li a'),
OpenNavBar=void 0;
self.fullscreenNavbarIsOpened=function (){
return OpenNavBar;
};
self.toogleOpenCloseMobileMenu=function (){
self[OpenNavBar ? 'closeFullscreenNavbar':'openFullscreenNavbar']();
};
self.openFullscreenNavbar=function (){
if(OpenNavBar||!$navbar_wrapper.length){
return;
}
OpenNavBar=1;
var $navbarMenuItems=$navbar_wrapper.find('.fl--mobile-menu >li >a,.fl--mobile-menu li.opened .sub-menu >li >a');
if(!$navbar_wrapper.find('.fl--mobile-menu >li.opened').length){
$navbarMenuItems=$navbar_wrapper.find('.fl--mobile-menu >li >a');
}
$hamburgerbars.addClass('opened');
$hamburgerbars.removeClass('closed');
TweenMax.set($navbarMenuItems, {
opacity: 0,
x: '-20%',
force3D: true
});
TweenMax.staggerTo($navbarMenuItems, 0.2, {
opacity: 1,
x: '0%',
delay: 0.4
}, 0.04);
TweenMax.set($social_profiles, {
opacity: 0,
y: '-100%',
force3D: true
});
TweenMax.staggerTo($social_profiles, 0.2, {
opacity: 1,
y: '0%',
delay: 0.6
}, 0.04);
TweenMax.set($navbar_wrapper, {
display: 'none',
force3D: true
});
TweenMax.to($navbar_wrapper, 0.4, {
opacity: 1,
display: 'block'
}, 0.04);
TweenMax.set($navbar_menu_sidebar, {
opacity: 0,
x: '-100%',
force3D: true
});
TweenMax.to($navbar_menu_sidebar, 0.4, {
opacity: 1,
x: '0%',
display: 'block'
}, 0.04);
$navbar_wrapper.addClass('open');
};
self.closeFullscreenNavbar=function (dontTouchBody){
if(!OpenNavBar||!$navbar_wrapper.length){
return;
}
OpenNavBar=0;
$hamburgerbars.removeClass('opened');
$hamburgerbars.addClass('closed');
var $navbarMenuItems=$navbar_wrapper.find('.fl--mobile-menu >li >a');
TweenMax.to($navbar_wrapper, 0.4, {
force3D: true,
opacity: 0,
display: 'none',
delay: 0.1
});
TweenMax.to($navbar_menu_sidebar, 0.2, {
opacity: 0,
x: '-100%',
force3D: true,
delay: 0.3
}, 0.1);
TweenMax.to($navbarMenuItems, 0.2, {
opacity: 0,
x: '-20%',
delay: 0.2
}, 0.1);
$navbar_wrapper.removeClass('open');
};
$doc.on('click', '.fl--hamburger-menu-wrapper,.fl--mobile-menu-icon,.fl--hamburger-menu', function (e){
self.toogleOpenCloseMobileMenu();
e.preventDefault();
});
};
fl_theme.initMobileNavigationSubMenuAnimation=function (){
var $mobileMenu=$('.fl--mobile-menu');
$mobileMenu.find('li').each(function (){
var $this=$(this);
if($this.find('ul').length > 0){
$this.find('> a').append('<span class="fl-menu-flipper-icon fl--open-child-menu"><span class="fl-front-content"><i class="fl-custom-icon-list-style-6"></i></span><span class="fl-back-content"><i class="fl-custom-icon-cancel-5"></i></span></span>');
}});
function toggleSub_menu($sub_menu_find){
var $navigation_Items=$sub_menu_find.find('.sub-nav >.sub-menu >li >a');
if(!$sub_menu_find.find('.sub-nav >.sub-menu >li.opened').length){
$navigation_Items=$sub_menu_find.find('.sub-menu >li >a');
}
TweenMax.set($navigation_Items, {
opacity: 0,
x: '-20%',
force3D: true
}, 0.04);
if($sub_menu_find.hasClass('opened')){
$sub_menu_find.removeClass('opened');
$sub_menu_find.find('li').removeClass('opened');
$sub_menu_find.find('ul').slideUp(200);
TweenMax.staggerTo($navigation_Items, 0.3, {
opacity: 0,
x: '-20%',
force3D: true
}, 0.04);
console.log($navigation_Items);
}else{
TweenMax.staggerTo($navigation_Items, 0.3, {
x: '0%',
opacity: 1,
delay: 0.2
}, 0.04);
$sub_menu_find.addClass('opened');
if(!$sub_menu_find.children('ul').length){
$sub_menu_find.find('div').children('ul').slideDown();
}else{
$sub_menu_find.children('ul').slideDown();
}
$sub_menu_find.siblings('li').children('ul').slideUp(200);
$sub_menu_find.siblings('li').removeClass('opened');
$sub_menu_find.siblings('li').find('li').removeClass('opened');
$sub_menu_find.siblings('li').find('ul').slideUp(200);
}}
$mobileMenu.on('click', 'li.has-submenu >a', function (e){
toggleSub_menu($(this).parent());
e.preventDefault();
});
};
fl_theme.initVelocityAnimationSave=function (){
var animated_velocity=$('.fl-animated-item-velocity');
animated_velocity.each(function (){
var $this=$(this),
$item;
if($this.data('item-for-animated')){
$item=$this.find($this.data('item-for-animated'));
$item.each(function (){
if(!$(this).hasClass('animation-complete')){
$(this).css('opacity', '0');
}});
}else{
if(!$this.hasClass('animation-complete')){
$this.css('opacity', '0');
}}
});
animated_velocity.each(function (){
var $this_item=$(this),
$item, $animation;
$animation=$this_item.data('animate-type');
if($this_item.data('item-for-animated')){
$item=$this_item.find($this_item.data('item-for-animated'));
$item.each(function (){
var $this=$(this);
var delay='';
if($this_item.data('item-delay')){
delay=$this_item.data('item-delay');
}else{
if($this.data('item-delay')){
delay=$this.data('item-delay');
}}
$this.waypoint(function (){
if(!$this.hasClass('animation-complete')){
$this.addClass('animation-complete')
.velocity('transition.' + $animation, {
delay: delay,
display: 'undefined',
opacity: 1
});
}}, {
offset: offset
});
});
}else{
$this_item.waypoint(function (){
var delay='';
if($this_item.data('item-delay')){
delay=$this_item.data('item-delay');
}
if(!$this_item.hasClass('animation-complete')){
$this_item.addClass('animation-complete')
.velocity('transition.' + $animation, {
delay: delay,
display: 'undefined',
opacity: 1
});
}}, {
offset: offset
});
}});
};
fl_theme.initPostSlider=function (){
$('#pixad-carousel').each(function (){
$(this).slick({
dots: false,
infinite: false,
speed: 300,
slidesToShow: 4,
slidesToScroll: 1,
adaptiveHeight: true,
arrows: true,
nextArrow: "<i class='fa fa-angle-right' aria-hidden='true'></i>",
prevArrow: "<i class='fa fa-angle-left' aria-hidden='true'></i>",
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
infinite: false,
dots: false
}},
{
breakpoint: 600,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}},
{
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}}
]
});
$(this).slick('refresh');
});
$('.pixad-carousel').each(function (){
$(this).slick({
dots: false,
infinite: false,
speed: 300,
slidesToShow: 4,
slidesToScroll: 1,
adaptiveHeight: true,
arrows: true,
nextArrow: "<i class='fa fa-angle-right' aria-hidden='true'></i>",
prevArrow: "<i class='fa fa-angle-left' aria-hidden='true'></i>",
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
infinite: false,
dots: false
}},
{
breakpoint: 600,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}},
{
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}}
]
});
});
$('.post-gallery-slider').each(function (){
$(this).slick({
dots: false,
infinite: false,
draggable: true,
speed: 600,
nextArrow: '.slider-arrow-right',
prevArrow: '.slider-arrow-left',
});
});
};
fl_theme.initSharePostArchive=function (){
$('body').on('click', '.share-post', function (e){
if($(this).hasClass('closed')){
$(this).removeClass('closed').addClass('opened');
$(this).parent().find('.post-share-icon').removeClass('closed').addClass('opened');
}else{
$(this).removeClass('opened').addClass('closed');
$(this).parent().find('.post-share-icon').removeClass('opened').addClass('closed');
}
e.preventDefault();
});
};
fl_theme.initVenoBoxFunction=function (){
var venobox=$('.venobox');
if(venobox.length){
venobox.each(function (){
$(this).venobox();
});
}};
fl_theme.initVcCustomFunction=function (){
var initVcShortcodeFunction=function (){
initVelocityAnimation();
initCounterFunction();
initHotspot();
initTestimonialSlider();
initProgressBarFunction();
initAccordionFunction();
initTabsVCFunction();
initProgressBar();
initGallerySlider();
initAutoHomePageSlider();
},
initVelocityAnimation=function (){
var animated_velocity=$('.fl-animated-item-velocity');
animated_velocity.each(function (){
var $this=$(this),
$item;
if($this.data('item-for-animated')){
$item=$this.find($this.data('item-for-animated'));
$item.each(function (){
if(!$(this).hasClass('animation-complete')){
$(this).css('opacity', '0');
}});
}else{
if(!$this.hasClass('animation-complete')){
$this.css('opacity', '0');
}}
});
animated_velocity.each(function (){
var $this_item=$(this),
$item, $animation;
$animation=$this_item.data('animate-type');
if($this_item.data('item-for-animated')){
$item=$this_item.find($this_item.data('item-for-animated'));
$item.each(function (){
var $this=$(this);
var delay='';
if($this_item.data('item-delay')){
delay=$this_item.data('item-delay');
}else{
if($this.data('item-delay')){
delay=$this.data('item-delay');
}}
$this.waypoint(function (){
if(!$this.hasClass('animation-complete')){
$this.addClass('animation-complete')
.velocity('transition.' + $animation, {
delay: delay,
display: 'undefined',
opacity: 1
});
}}, {
offset: offset
});
});
}else{
$this_item.waypoint(function (){
var delay='';
if($this_item.data('item-delay')){
delay=$this_item.data('item-delay');
}
if(!$this_item.hasClass('animation-complete')){
$this_item.addClass('animation-complete')
.velocity('transition.' + $animation, {
delay: delay,
display: 'undefined',
opacity: 1
});
}}, {
offset: offset
});
}});
},
initCounterFunction=function (){
var fl_counter=$('.fl-counter');
fl_counter.each(function (){
var $this=$(this);
$this.waypoint(function (){
$this.countTo();
}, {
offset: offset
});
});
},
initHotspot=function (){
var initOffsets=function (){
$('.fl-hotspot-shortcode').each(function (){
$(this).find('.HotspotPlugin_Hotspot').each(function (index){
var $self=$(this);
if(!$self.parents('.fp-scroller').length){
if(!$self.hasClass('animation-done')){
$self.css('opacity', '0');
}
$self.waypoint(function (){
if(!$self.hasClass('animation-done')){
$self.addClass('animation-done')
.velocity('transition.slideUpBigIn', {
display: 'block',
opacity: '1',
delay: index * 20,
complete: function (el){
$(el).css({
'-webkit-transform': 'none',
'-moz-transform': 'none',
'-o-transform': 'none',
'transform': 'none'
});
}});
}}, {
offset: offset
});
}});
});
};
$('.fl-hotspot-shortcode').each(function (){
var $self=$(this),
hotspotContent=$self.data('hotspot-content') ? $self.data('hotspot-content'):'';
if(hotspotContent!=''&&!$self.find('.fl-hotspot-image-cover').hasClass('fl-htospot-inited')){
$self.find('.fl-hotspot-image-cover').addClass('fl-htospot-inited').hotspot({
hotspotClass: 'HotspotPlugin_Hotspot',
interactivity: 'hover',
data: decodeURIComponent(hotspotContent)
});
}});
$('body').on('fl-hotspot-inited', initOffsets);
initOffsets();
window.fl_theme.window.on('resize', initOffsets);
},
initTestimonialSlider=function (){
var testimonial_slider=$('.testimonial-slider');
if(testimonial_slider.length){
testimonial_slider.each(function (){
var $this=$(this);
if($this.hasClass('testimonial-style-two')){
$this.not('.slick-initialized').slick({
dots: true,
infinite: true,
prevArrow: null,
nextArrow: null,
autoplay: true,
autoplaySpeed: 6000,
speed: 500,
slidesToShow: 1,
slidesToScroll: 1,
draggable: true,
swipeToSlide: true,
});
}else{
$this.not('.slick-initialized').slick({
dots: true,
infinite: true,
prevArrow: null,
nextArrow: null,
autoplay: true,
autoplaySpeed: 6000,
speed: 500,
slidesToShow: 3,
slidesToScroll: 1,
draggable: true,
centerMode: true,
swipeToSlide: true,
centerPadding: '10px',
responsive: [
{
breakpoint: 993,
settings: {
slidesToShow: 2,
slidesToScroll: 1
}},
{
breakpoint: 769,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}},
]
});
}});
}},
initProgressBarFunction=function (){
var fl_progress_bar=$('.fl-progress-bar');
fl_progress_bar.each(function (){
var $this=$(this);
$this.waypoint(function (){
var duration_progress=Number($this.attr("data-duration"));
$this.find('.fl-tracking-progress-bar__item').animate({
width: $this.attr('data-progress-width')
}, duration_progress);
$this.find('.fl-progress-wrapper').animate({
text: $this.attr('data-progress-width')
}, {
duration: duration_progress,
step: function (now){
var data=Math.round(now);
$this.find('.fl-progress-bar__number .fl-animated-number').html(data + '%');
}});
}, {
offset: offset
});
});
},
initAccordionFunction=function (){
var fl_accordion=$('.fl-accordion');
fl_accordion.each(function (){
var $this=$(this);
$this.find('.vc_tta-panel-heading .vc_tta-panel-title a').prepend("<span class='fl-tta-panel-icon'><i class='fa fa-reply'></i></span>");
});
},
initTabsVCFunction=function (){
var tabs=$(".fl-vc-tabs");
tabs.each(function (){
var customClass=$(this).attr('data-custom-tabs-class');
if($(customClass).hasClass('active-on-hover')){
$(customClass).on('click mouseenter', '.nav-tabs li', function (e){
var $this=$(this),
parrent=$this.parent(),
data=$this.attr('data-tab');
$(customClass).find('.nav-tabs li').removeClass('active');
$this.addClass('active');
$(customClass).find('.tab-content .tab-pane').removeClass('active');
$(customClass).find('.' + data).addClass('active');
e.preventDefault();
});
}else{
$(customClass).on('click', '.nav-tabs li', function (e){
var $this=$(this),
parrent=$this.parent(),
data=$this.attr('data-tab');
$(customClass).find('.nav-tabs li').removeClass('active');
$this.addClass('active');
$(customClass).find('.tab-content .tab-pane').removeClass('active');
$(customClass).find('.' + data).addClass('active');
e.preventDefault();
});
}})
},
initProgressBar=function (){
$(".vc-semi-circle-progress-bar").each(function (){
var bar=$(this).find(".bar"),
val=$(this).find("span"),
per=parseInt(val.text(), 10),
$this=$(this);
$this.waypoint(function (){
if(!$this.hasClass('animation-progress-complete')){
$({
p: 0
}).animate({
p: per
}, {
duration: 1500,
step: function (p){
bar.css({
transform: "rotate(" + (45 + (p * 1.8)) + "deg)"
});
val.text(p | 0);
}}).delay(200);
$this.addClass('animation-progress-complete');
}}, {
offset: offset
});
});
},
initGallerySlider=function (){
var Gallery_slider=$('.fl-gallery-slider');
if(Gallery_slider.length){
Gallery_slider.each(function (){
var $this=$(this),
normal_count_slider=$this.attr('data-count-item'),
table_count_slider=$this.attr('data-count-table-item'),
mobile_count_slider=$this.attr('data-count-mobile-item');
$this.not('.slick-initialized').slick({
dots: false,
infinite: true,
prevArrow: null,
nextArrow: null,
autoplay: true,
autoplaySpeed: 6000,
speed: 500,
slidesToShow: normal_count_slider,
slidesToScroll: 1,
draggable: true,
swipeToSlide: true,
responsive: [
{
breakpoint: 993,
settings: {
slidesToShow: table_count_slider,
slidesToScroll: 1
}}, {
breakpoint: 769,
settings: {
slidesToShow: mobile_count_slider,
slidesToScroll: 1
}},
]
});
});
}},
initAutoHomePageSlider=function (){
var Auto_slider_one=$('.fl-cars-slider-wrap-vc.car-slider-style-one-wrap .cars-slider');
var Auto_slider_two=$('.fl-cars-slider-wrap-vc.car-slider-style-two-wrap .cars-slider');
if(Auto_slider_one.length){
Auto_slider_one.each(function (){
var $this=$(this);
$this.not('.slick-initialized').slick({
dots: false,
infinite: true,
autoplay: true,
autoplaySpeed: 6000,
speed: 500,
slidesToShow: 3,
slidesToScroll: 1,
draggable: true,
swipeToSlide: true,
prevArrow: $this.parent().find('.slider-arrow-left'),
nextArrow: $this.parent().find('.slider-arrow-right'),
responsive: [
{
breakpoint: 993,
settings: {
slidesToShow: 2,
slidesToScroll: 1
}}, {
breakpoint: 400,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}},
]
});
});
}
if(Auto_slider_two.length){
Auto_slider_two.each(function (){
var $this=$(this);
$this.not('.slick-initialized').slick({
dots: false,
infinite: true,
autoplay: true,
autoplaySpeed: 6000,
speed: 500,
slidesToShow: 5,
slidesToScroll: 1,
draggable: true,
swipeToSlide: true,
prevArrow: $('.car-slider-arrow-style-two-wrap .slider-arrow-left'),
nextArrow: $('.car-slider-arrow-style-two-wrap .slider-arrow-right'),
responsive: [
{
breakpoint: 1500,
settings: {
slidesToShow: 4,
slidesToScroll: 1
}}, {
breakpoint: 1140,
settings: {
slidesToShow: 3,
slidesToScroll: 1
}}, {
breakpoint: 991,
settings: {
slidesToShow: 2,
slidesToScroll: 1
}}, {
breakpoint: 530,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}},
]
});
});
}};
fl_theme.document.ready(function (){
initVcShortcodeFunction();
});
$('body').on('post-load', initVcShortcodeFunction);
};
fl_theme.initLineHeightСheck=function (){
var $element=$('.post-inner_content >p ,.single-page-wrapper >p');
$element.each(function (){
if($(this).css("font-size") >="20px"){
$(this).css('line-height', '1.6');
}});
};
fl_theme.initSellCar=function (){
var step1=$('#step01');
var step2=$('#step02');
var step3=$('#step03');
var step4=$('#step04');
var step5=$('#step05');
if(step1.length){
step1.waypoint(function (){
$(".b-submit__aside-step").removeClass('m-active');
$(".b-submit__aside-step-inner").removeClass('m-active');
$(".step01").addClass('m-active');
$(".step01 .b-submit__aside-step-inner").addClass('m-active');
}, {
triggerOnce: false,
offset: '55%'
});
}
if(step2.length){
step2.waypoint(function (){
$(".b-submit__aside-step").removeClass('m-active');
$(".b-submit__aside-step-inner").removeClass('m-active');
$(".step02").addClass('m-active');
$(".step02 .b-submit__aside-step-inner").addClass('m-active');
}, {
triggerOnce: false,
offset: '55%'
});
}
if(step3.length){
step3.waypoint(function (){
$(".b-submit__aside-step").removeClass('m-active');
$(".b-submit__aside-step-inner").removeClass('m-active');
$(".step03").addClass('m-active');
$(".step03 .b-submit__aside-step-inner").addClass('m-active');
}, {
triggerOnce: false,
offset: '55%'
});
}
if(step4.length){
step4.waypoint(function (){
$(".b-submit__aside-step").removeClass('m-active');
$(".b-submit__aside-step-inner").removeClass('m-active');
$(".step04").addClass('m-active');
$(".step04 .b-submit__aside-step-inner").addClass('m-active');
}, {
triggerOnce: false,
offset: '55%'
});
}
if(step5.length){
step5.waypoint(function (){
$(".b-submit__aside-step").removeClass('m-active');
$(".b-submit__aside-step-inner").removeClass('m-active');
$(".step05").addClass('m-active');
$(".step05 .b-submit__aside-step-inner").addClass('m-active');
}, {
triggerOnce: false,
offset: '55%'
});
}};
fl_theme.initCustomFunction=function (){
fl_theme.initEventsCustom();
fl_theme.initStikySidebar();
fl_theme.initResponsiveIframe();
fl_theme.initImagePopup();
fl_theme.initGalleryPopup();
fl_theme.initCustomSelect();
fl_theme.initMobileNavigationOpenClose();
fl_theme.initMobileNavigationSubMenuAnimation();
fl_theme.initHeaderSearchForm();
fl_theme.initLoginFormOptionFunction();
fl_theme.initNavBarFixed();
fl_theme.initCarsSlider();
fl_theme.initCustomTabs();
fl_theme.initCarGoogleMaps();
fl_theme.initGridSwitchCar();
fl_theme.initCustomWidgetRange();
fl_theme.initCustomWidgetFunction();
fl_theme.initCustomHeidthIframeSlider();
fl_theme.initVcCustomFunction();
fl_theme.initSharePostArchive();
fl_theme.initPostSlider();
fl_theme.initVenoBoxFunction();
fl_theme.initLineHeightСheck();
fl_theme.initSellCar();
};
fl_theme.initCustomFunction();
$($window).resize(function (){
fl_theme.initResponsiveIframe();
fl_theme.initNavBarFixed();
fl_theme.initResponsiveIframe();
fl_theme.initCustomHeidthIframeSlider();
setTimeout(fl_theme.initCustomHeidthIframeSlider, 200);
});
$('.tmreviews_woo_view_btn').click(function (e){
var orderid=$(this).data('orderid');
if($('.woo_table_details_show*[data-orderid="' + orderid + '"]').hasClass('open')){
$('.woo_table_details_show*[data-orderid="' + orderid + '"]').removeClass('open');
}else{
$('.woo_table_details_show*[data-orderid="' + orderid + '"]').addClass('open');
}});
fl_theme.accordionFunction=function (){
$(document).on('click', "[data-spoiler-trigger]", function (e){
const __this=$(this);
const __target=$(e.target);
if(__target.closest('button').length > 0) return;
let box=__this.closest("[data-spoiler]");
if(box.attr('data-spoiler')==='active'){
box.attr('data-spoiler', '');
}else{
box.closest('[data-spoiler-list="accordion"]').find('[data-spoiler="active"]').attr('data-spoiler', '');
box.attr('data-spoiler', 'active');
}
document.dispatchEvent(new Event("trigger-spoiler"));
});
};
fl_theme.accordionFunction();
});