"use strict"; //Wrapping all JavaScript code into a IIFE function for prevent global variables creation (function ($) { var $body = $('body'); var $window = $(window); //hidding menu elements that do not fit in menu width //processing center logo function menuHideExtraElements() { //cleaneng changed elements jQuery('.sf-more-li, .sf-logo-li').remove(); var windowWidth = jQuery('body').innerWidth(); jQuery('.sf-menu').each(function () { var $thisMenu = jQuery(this); var $menuWraper = $thisMenu.closest('.mainmenu_wrapper'); $menuWraper.attr('style', ''); if (windowWidth > 991) { //grab all main menu first level items var $menuLis = $menuWraper.find('.sf-menu > li'); $menuLis.removeClass('sf-md-hidden'); var $headerLogoCenter = $thisMenu.closest('.header_logo_center'); var logoWidth = 0; var summaryLiWidth = 0; if ($headerLogoCenter.length) { var $logo = $headerLogoCenter.find('.logo'); // 30/2 - left and right margins logoWidth = $logo.outerWidth(true) + 70; } var wrapperWidth = $menuWraper.outerWidth(true); $menuLis.each(function (index) { var elementWidth = jQuery(this).outerWidth(); summaryLiWidth += elementWidth; if (summaryLiWidth >= (wrapperWidth - logoWidth)) { var $newLi = jQuery('
  • ...
  • '); jQuery('ul.children').addClass('sub-menu'); jQuery($menuLis[index - 1]).before($newLi); var newLiWidth = jQuery($newLi).outerWidth(true); var $extraLiElements = $menuLis.filter(':gt(' + (index - 2) + ')'); $extraLiElements.clone().appendTo($newLi.find('ul')); $extraLiElements.addClass('sf-md-hidden'); return false; } }); //processing center logo if ($headerLogoCenter.length) { var $menuLisVisible = $headerLogoCenter.find('.sf-menu > li:not(.sf-md-hidden)'); var menuLength = $menuLisVisible.length; var summaryLiVisibleWidth = 0; $menuLisVisible.each(function () { summaryLiVisibleWidth += jQuery(this).outerWidth(); }); var centerLi = Math.floor(menuLength / 2); if ((menuLength % 2 === 0)) { centerLi--; } var $liLeftFromLogo = $menuLisVisible.eq(centerLi); $liLeftFromLogo.after('
  • '); $headerLogoCenter.find('.sf-logo-li').width(logoWidth); var liLeftRightDotX = $liLeftFromLogo.offset().left + $liLeftFromLogo.outerWidth(); var logoLeftDotX = windowWidth / 2 - logoWidth / 2; var menuLeftOffset = liLeftRightDotX - logoLeftDotX; $menuWraper.css({ 'left': -menuLeftOffset }) } }// > 991 }); //sf-menu each } //menuHideExtraElements function initMegaMenu() { var $megaMenu = jQuery('.mainmenu_wrapper .mega-menu'); if ($megaMenu.length) { var windowWidth = jQuery('body').innerWidth(); if (windowWidth > 991) { $megaMenu.each(function () { var $thisMegaMenu = jQuery(this); //temporary showing mega menu to propper size calc $thisMegaMenu.css({ 'display': 'block', 'left': 'auto' }); var thisWidth = $thisMegaMenu.outerWidth(); var thisOffset = $thisMegaMenu.offset().left; var thisLeft = (thisOffset + (thisWidth / 2)) - windowWidth / 2; $thisMegaMenu.css({ 'left': -thisLeft, 'display': 'none' }); if (!$thisMegaMenu.closest('ul').hasClass('nav')) { $thisMegaMenu.css('left', ''); } }); } } } function pieChart() { //circle progress bar if (jQuery().easyPieChart) { jQuery('.chart').each(function () { var $currentChart = jQuery(this); var imagePos = $currentChart.offset().top; var topOfWindow = jQuery(window).scrollTop(); if (imagePos < topOfWindow + 900) { var size = $currentChart.data('size') ? $currentChart.data('size') : 270; var line = $currentChart.data('line') ? $currentChart.data('line') : 20; var bgcolor = $currentChart.data('bgcolor') ? $currentChart.data('bgcolor') : '#ffffff'; var trackcolor = $currentChart.data('trackcolor') ? $currentChart.data('trackcolor') : '#c14240'; var speed = $currentChart.data('speed') ? $currentChart.data('speed') : 3000; $currentChart.easyPieChart({ barColor: trackcolor, trackColor: bgcolor, scaleColor: false, scaleLength: false, lineCap: 'butt', lineWidth: line, size: size, rotate: 0, animate: speed, onStep: function (from, to, percent) { jQuery(this.el).find('.percent').text(Math.round(percent)); } }); } }); } } function affixSidebarInit() { var $affixAside = jQuery('.affix-aside'); if ($affixAside.length) { //on stick and unstick event $affixAside.on('affix.bs.affix', function (e) { var affixWidth = $affixAside.width() - 1; var affixLeft = $affixAside.offset().left; $affixAside .width(affixWidth) .css("left", affixLeft); }).on('affix-top.bs.affix affix-bottom.bs.affix', function (e) { $affixAside.css({ "width": "", "left": "" }); }); //counting offset var offsetTop = $affixAside.offset().top - jQuery('.page_header').height(); var offsetBottom = jQuery('.page_footer').outerHeight(true) + jQuery('.page_copyright').outerHeight(true); $affixAside.affix({ offset: { top: offsetTop, bottom: offsetBottom }, }); jQuery(window).on('resize', function () { $affixAside.css({ "width": "", "left": "" }); if ($affixAside.hasClass('affix')) { //returning sidebar in top position if it is sticked because of unexpacted behavior $affixAside.removeClass("affix").css("left", "").addClass("affix-top"); } var offsetTop = jQuery('.page_topline').outerHeight(true) + jQuery('.page_toplogo').outerHeight(true) + jQuery('.page_breadcrumbs').outerHeight(true) + jQuery('.page_header').outerHeight(true); var offsetBottom = jQuery('.page_footer').outerHeight(true) + jQuery('.page_copyright').outerHeight(true); $affixAside.data('bs.affix').options.offset.top = offsetTop; $affixAside.data('bs.affix').options.offset.bottom = offsetBottom; $affixAside.affix('checkPosition'); }); }//eof checking of affix sidebar existing } //photoSwipe gallery plugin function initPhotoSwipe() { if (typeof PhotoSwipe !== 'undefined') { //adding prettyPhoto for backward compatibility. Deprecated. //will leave only .photoswipe-link later var gallerySelectors = '.photoswipe-link, a[data-gal^="prettyPhoto"], [data-thumb] a'; var $galleryLinks = $(gallerySelectors); if ($galleryLinks.length) { //adding photoswipe gallery markup if (!($('.pswp').length)) { $body.append(''); //if function already was called - return (all listeners was setted and .pswp gallery container was added) } else { return; } //adding prettyPhoto for backward compatibility. Deprecated. $('body').on('click', gallerySelectors, function (e) { e.preventDefault(); var $link = $(this); var $linksParentContainer = $link.closest('.photoswipe-container, .isotope-wrapper, .owl-carousel, .flickr_ul, .images, .model-images'); var $links = $linksParentContainer.find(gallerySelectors); //if no container only adding this link if (!$links.length) { $links.push($link); } var items = []; var options = { bgOpacity: 0.7, showHideOpacity: true, history: false, shareEl: false, //data index is set in owl carousel init index: $link.data('index') ? $link.data('index') : 0 }; var gallery = $('.pswp')[0]; //building items array $links.each(function (i) { var $this = $(this); //if cloned element (owl or flexslider thumbs) - continue if ($this.closest('.clone, .cloned').length) { return; } var item = {}; //if not owl carousel if (($link[0] === $this[0]) && !($link.data('index'))) { //start from 0 if ($linksParentContainer.hasClass('owl-carousel') || $linksParentContainer.hasClass('images')) { options.index = i - 1; } else { options.index = i; } } //video or image if ($this.data('iframe')) { var autoplay = ($links.length > 1) ? '' : '&autoplay=1'; item.html = '
    '; // item.html += ''; item.html += ''; item.html += '
    '; } else { item.src = $this.attr('href'); //default values var width = 1170; var height = 780; //template data on A element var data = $this.data(); //image data in Woo var dataImage = $this.find('img').first().data(); if (data.width) { width = data.width; } if (data.height) { height = data.height; } if (typeof dataImage !== 'undefined') { if (dataImage.large_image_width) { width = dataImage.large_image_width; } if (dataImage.large_image_height) { height = dataImage.large_image_height; } } item.w = width; item.h = height; } items.push(item); }); var pswpGallery = new PhotoSwipe(gallery, PhotoSwipeUI_Default, items, options); pswpGallery.init(); //pausing video on close and on slide change pswpGallery.listen('afterChange', function () { $(pswpGallery.container).find('iframe').each(function () { //"method":"pause" - form Vimeo, other - for YouTube $(this)[0].contentWindow.postMessage('{"method":"pause","event":"command","func":"pauseVideo","args":""}', '*') }); }); pswpGallery.listen('close', function () { $(pswpGallery.container).find('iframe').each(function () { //"method":"pause" - form Vimeo, other - for YouTube $(this)[0].contentWindow.postMessage('{"method":"pause","event":"command","func":"pauseVideo","args":""}', '*') }); }); }); } } } //function that initiating template plugins on document.ready event function documentReadyInit() { //////////// //mainmenu// //////////// if (jQuery().scrollbar) { jQuery('[class*="scrollbar-"]').scrollbar(); } if (jQuery().superfish) { jQuery('ul.sf-menu').superfish({ popUpSelector: 'ul:not(.mega-menu ul), .mega-menu ', delay: 700, animation: { opacity: 'show', marginTop: 38 }, animationOut: { opacity: 'hide', marginTop: 45 }, speed: 200, speedOut: 200, disableHI: false, cssArrows: true, autoArrows: true, onInit: function () { var $thisMenu = jQuery(this); $thisMenu.find('.sf-with-ul').after(''); $thisMenu.find('.sf-menu-item-mobile-toggler').on('click', function (e) { var $parentLi = jQuery(this).parent(); if ($parentLi.hasClass('sfHover')) { $parentLi.superfish('hide'); } }); } }); jQuery('ul.sf-menu-side').superfish({ popUpSelector: 'ul:not(.mega-menu ul), .mega-menu ', delay: 500, animation: { opacity: 'show', height: 100 + '%' }, animationOut: { opacity: 'hide', height: 0 }, speed: 400, speedOut: 300, disableHI: false, cssArrows: true, autoArrows: true }); } //toggle mobile menu jQuery('.toggle_menu').on('click', function () { jQuery('.toggle_menu').toggleClass('mobile-active'); jQuery('.page_header').toggleClass('mobile-active'); }); jQuery('.mainmenu a').on('click', function () { if (!jQuery(this).hasClass('sf-with-ul')) { jQuery('.toggle_menu').toggleClass('mobile-active'); jQuery('.page_header').toggleClass('mobile-active'); } }); //side header processing var $sideHeader = jQuery('.page_header_side'); if ($sideHeader.length) { var $body = jQuery('body'); jQuery('.toggle_menu_side').on('click', function () { if (jQuery(this).hasClass('header-slide')) { $sideHeader.toggleClass('active-slide-side-header'); } else { if (jQuery(this).parent().hasClass('header_side_right')) { $body.toggleClass('active-side-header slide-right'); } else { $body.toggleClass('active-side-header'); } } }); // toggle sub-menus visibility on menu-side-click jQuery('ul.menu-side-click').find('li').each(function () { var $thisLi = jQuery(this); //toggle submenu only for menu items with submenu if ($thisLi.find('ul').length) { $thisLi .append('') .find('.activate_submenu, > a') .on('click', function (e) { var $thisSpanOrA = $(this); //if this is a link and it is already opened - going to link if (($thisSpanOrA.attr('href') === '#') || !($thisSpanOrA.parent().hasClass('active-submenu'))) { e.preventDefault(); } if ($thisSpanOrA.parent().hasClass('active-submenu')) { $thisSpanOrA.parent().removeClass('active-submenu'); return; } $thisLi.addClass('active-submenu').siblings().removeClass('active-submenu'); }); } //eof sumbenu check }); // toggle sub-menus visibility on menu-side-click for vertical_menu_header jQuery('.vertical_menu_header ul.menu-side-click').find('li.menu-item-has-children').each(function () { var $thisLi = jQuery(this); var $thisA = $thisLi.children('a'); //toggle submenu only for menu items with submenu $thisA .after(''); $thisLi .find('.activate_submenu') .on('click', function () { var $thisSpan = jQuery(this); if ($thisSpan.parent().hasClass('active-submenu')) { $thisSpan.parent().removeClass('active-submenu'); return; } $thisLi.addClass('active-submenu').siblings().removeClass('active-submenu'); }); }); //hidding side header on click outside header jQuery('body').on('click', function (e) { if (!jQuery(e.target).closest('.page_header_side').length) { $sideHeader.removeClass('active-slide-side-header'); $body.removeClass('active-side-header slide-right'); } }); } //sideHeader check //1 and 2/3/4th level mainmenu offscreen fix var MainWindowWidth = jQuery(window).width(); jQuery(window).on('resize', function () { MainWindowWidth = jQuery(window).width(); }); //2/3/4 levels jQuery('.mainmenu_wrapper .sf-menu').on('mouseover', 'ul li', function () { if (MainWindowWidth > 991) { var $this = jQuery(this); // checks if third level menu exist var subMenuExist = $this.find('ul').length; if (subMenuExist > 0) { var subMenuWidth = $this.find('ul, div').first().width(); var subMenuOffset = $this.find('ul, div').first().parent().offset().left + subMenuWidth; // if sub menu is off screen, give new position if ((subMenuOffset + subMenuWidth) > MainWindowWidth) { var newSubMenuPosition = subMenuWidth + 0; $this.find('ul, div').first().css({ left: -newSubMenuPosition, }); } else { $this.find('ul, div').first().css({ left: '100%', }); } } } //1st level }).on('mouseover', '> li', function () { if (MainWindowWidth > 991) { var $this = jQuery(this); var subMenuExist = $this.find('ul').length; if (subMenuExist > 0) { var subMenuWidth = $this.find('ul').width(); var subMenuOffset = $this.find('ul').parent().offset().left; // if sub menu is off screen, give new position if ((subMenuOffset + subMenuWidth) > MainWindowWidth) { var newSubMenuPosition = MainWindowWidth - (subMenuOffset + subMenuWidth); $this.find('ul').first().css({ left: newSubMenuPosition, }); } } } }); ///////////////////////////////////////// //single page localscroll and scrollspy// ///////////////////////////////////////// var navHeight = jQuery('.page_header').outerHeight(true); if (jQuery('.mainmenu_wrapper').length) { jQuery('body').scrollspy({ target: '.mainmenu_wrapper', offset: navHeight }) } if (jQuery('.mainmenu_side_wrapper').length) { jQuery('body').scrollspy({ target: '.mainmenu_side_wrapper', offset: navHeight }); } if (jQuery().localScroll) { jQuery('.mainmenu_wrapper > ul, .mainmenu_side_wrapper > ul, #land').localScroll({ duration: 900, easing: 'easeInOutQuart', offset: -navHeight + 10 }); } //toTop if (jQuery().UItoTop) { jQuery().UItoTop({ easingType: 'easeOutQuart' }); } //parallax if (jQuery().parallax) { jQuery('.parallax').parallax("50%", 0.01); } // Date Time Picker jQuery('[id ^= id-date]').each(function () { var datePicker = jQuery(this); datePicker.datetimepicker({ pickDate: datePicker.data('pick-date'), pickTime: datePicker.data('pick-time'), useSeconds: false, language: datePicker.data('language'), debug: false, }); }); // Smooth scrolling for slider button if (jQuery().localScroll) { jQuery('.mainmenu_wrapper > ul, .mainmenu_side_wrapper > ul, #land, .scroll_button_wrap').localScroll({ duration: 900, easing: 'easeInOutQuart', offset: -navHeight + 10 }); } if (jQuery().localScroll) { jQuery('.divided-content').localScroll({ duration: 900, easing: 'easeInOutQuart', offset: -navHeight + 10 }); } //prettyPhoto if (jQuery().prettyPhoto) { jQuery("a[data-gal^='prettyPhoto']").prettyPhoto({ hook: 'data-gal', theme: 'facebook' /* light_rounded / dark_rounded / light_square / dark_square / facebook / pp_default*/ }); } initPhotoSwipe(); //////////////////////////////////////// //init Twitter Bootstrap JS components// //////////////////////////////////////// //bootstrap carousel if (jQuery().carousel) { jQuery('.carousel').carousel(); } //bootstrap tab - show first tab jQuery('.nav-tabs').each(function () { jQuery(this).find('a').first().tab('show'); }); jQuery('.tab-content').each(function () { jQuery(this).find('.tab-pane').first().addClass('fade in'); }); //bootstrap collapse - show first tab jQuery('.panel-group').each(function () { jQuery(this).find('a').first().filter('.collapsed').trigger('click'); }); //tooltip if (jQuery().tooltip) { jQuery('[data-toggle="tooltip"]').tooltip(); } //////////////// //owl carousel// //////////////// if (jQuery().owlCarousel) { jQuery('.owl-carousel').each(function () { var $carousel = jQuery(this); var loop = $carousel.data('loop') ? $carousel.data('loop') : false; var margin = ($carousel.data('margin') || $carousel.data('margin') == 0) ? $carousel.data('margin') : 30; var nav = $carousel.data('nav') ? $carousel.data('nav') : false; var dots = $carousel.data('dots') ? $carousel.data('dots') : false; var themeClass = $carousel.data('themeclass') ? $carousel.data('themeclass') : 'owl-theme'; var center = $carousel.data('center') ? $carousel.data('center') : false; var items = $carousel.data('items') ? $carousel.data('items') : 4; var autoplay = $carousel.data('autoplay') ? $carousel.data('autoplay') : false; var autoplayTimeout = $carousel.data('autoplaytimeout') ? $carousel.data('autoplaytimeout') : 3000; var responsiveXs = $carousel.data('responsive-xs') ? $carousel.data('responsive-xs') : 1; var responsiveSm = $carousel.data('responsive-sm') ? $carousel.data('responsive-sm') : 2; var responsiveMd = $carousel.data('responsive-md') ? $carousel.data('responsive-md') : 3; var responsiveLg = $carousel.data('responsive-lg') ? $carousel.data('responsive-lg') : 4; var syncedClass = $carousel.data('synced-class') ? $carousel.data('synced-class') : false; var filters = $carousel.data('filters') ? $carousel.data('filters') : false; var navContainer = $carousel.data('nav-container') ? $carousel.data('nav-container') : false; var owlSlider = $carousel.data('owlCarouselSlider') ? $carousel.data('owlCarouselSlider') : false; if (filters) { $carousel.after($carousel.clone().addClass('owl-carousel-filter-cloned')); jQuery(filters).on('click', 'a', function (e) { //processing filter link e.preventDefault(); if (jQuery(this).hasClass('selected')) { return; } var filterValue = jQuery(this).attr('data-filter'); jQuery(this).siblings().removeClass('selected active'); jQuery(this).addClass('selected active'); //removing old items $carousel.find('.owl-item').length; for (var i = $carousel.find('.owl-item').length - 1; i >= 0; i--) { $carousel.trigger('remove.owl.carousel', [1]); } //adding new items var $filteredItems = jQuery($carousel.next().find(' > ' + filterValue).clone()); $filteredItems.each(function () { $carousel.trigger('add.owl.carousel', jQuery(this)); jQuery(this).addClass('scaleAppear'); }); $carousel.trigger('refresh.owl.carousel'); //reinit prettyPhoto in filtered OWL carousel if (jQuery().prettyPhoto) { $carousel.find("a[data-gal^='prettyPhoto']").prettyPhoto({ hook: 'data-gal', theme: 'facebook' /* light_rounded / dark_rounded / light_square / dark_square / facebook / pp_default*/ }); } }); } //filters $carousel.owlCarousel({ loop: loop, margin: margin, nav: nav, autoplay: autoplay, autoplayTimeout: autoplayTimeout, dots: dots, themeClass: themeClass, center: center, items: items, navContainer: navContainer, responsive: { 0: { items: responsiveXs }, 767: { items: responsiveSm }, 992: { items: responsiveMd }, 1200: { items: responsiveLg } }, }) .addClass(themeClass); if (center) { $carousel.addClass('owl-center'); } //jQuery UI slider for owl carousel if (jQuery().slider) { $carousel.on('changed.owl.carousel', function (e) { var indexTo = e.item.index - e.page.size; jQuery(owlSlider).slider("option", "value", indexTo); return false; }); } //topline two synced carousels if (syncedClass) { $carousel.on('changed.owl.carousel', function (e) { var add = 1; if (e.item.count === 2) { add = 0; } if (e.item.count > 3) { add = 2; } var indexTo = loop ? e.item.index + add : e.item.index; $carousel.prev().trigger('to.owl.carousel', [indexTo]); return false; }) } }); } //eof owl-carousel //comingsoon counter if (jQuery().countdown) { //today date plus month for demo purpose var demoDate = new Date(); demoDate.setMonth(demoDate.getMonth() + 1); jQuery('#comingsoon-countdown').countdown({ until: demoDate }); } ///////////////////////////////////////////////// //PHP widgets - contact form, search, MailChimp// ///////////////////////////////////////////////// //search modal jQuery(".search_modal_button").on('click', function (e) { e.preventDefault(); jQuery('#search_modal').modal('show').find('input').first().focus(); }); //search form processing jQuery('form.searchform, .search-form').on('submit', function (e) { var $form = jQuery(this); var $searchModal = jQuery('#search_modal'); $searchModal.find('div.searchform-respond').remove(); //checking on empty values jQuery($form).find('[type="text"], [type="search"]').each(function (index) { if (!(jQuery(this).val().trim()).length) { jQuery(this).addClass('invalid').on('focus', function () { jQuery(this).removeClass('invalid') }); } }); //if one of form fields is empty - exit if ($form.find('[type="text"], [type="search"]').hasClass('invalid')) { e.preventDefault(); } }); //background image teaser jQuery(".bg_teaser").each(function () { var $teaser = jQuery(this); var imagePath = $teaser.find("img").first().attr("src"); if (imagePath) { $teaser.css("background-image", "url(" + imagePath + ")"); } if (!$teaser.find('.bg_overlay').length) { $teaser.prepend('
    '); } }); //background image cover - set image inside element with this class as a background to cover whole container jQuery(".cover-image").each(function () { var $element = jQuery(this); var $image = $element.find("img").first(); if (!$image.length) { $image = $element.parent().find("img").first(); } if (!$image.length) { return; } var imagePath = $image.attr("src"); $element.css("background-image", "url(" + imagePath + ")"); var $imageParent = $image.parent(); //if image inside link - adding this link if ($imageParent.is('a')) { $element.prepend($image.parent().clone().html('')); } }); jQuery('.format-chat p').each(function () { var $p = jQuery(this); $p.html($p.html().replace(/^(\w+:)/, '$1')); }); }//eof documentReadyInit //function that initiating template plugins on window.load event function windowLoadInit() { //chart pieChart(); //flexslider if (jQuery().flexslider) { //Team Slider Shortcode jQuery('.flexslider.team-slider').flexslider({ slideshow: false, animation: "slide", easing: "swing", direction: "horizontal", directionNav: false, manualControls: ".flex-control-nav-team .menu__item" }); jQuery(".flex-control-nav-team .menu__item").on('hover', function () { jQuery(this).click(); }); //flexslider - only for Model Single Page jQuery('.single-fw-model .model-images').flexslider({ animation: "slide", controlNav: false, selector: ".model-figure > div", directionNav: false }); jQuery('.single-fw-model .model-slider-thumbs').flexslider({ animation: "slide", controlNav: false, animationLoop: true, slideshow: false, itemWidth: 94, itemMargin: 18, maxItems: 4, asNavFor: '.model-images', customDirectionNav: jQuery(".custom-navigation a"), touch: true }); //flexslider - only for Model Slider Shortcode jQuery('.models-slider-shortcode .model-images').flexslider({ animation: "slide", controlNav: false, selector: ".model-figure > div", directionNav: true, sync: 'model-slider-thumbs', touch: true }); jQuery('.models-slider-shortcode .model-slider-thumbs').flexslider({ animation: "slide", animateOut: 'slideOutUp', animateIn: 'slideInUp', controlNav: false, directionNav: true, animationLoop: true, itemMargin: 44, itemWidth: 95, asNavFor: '.model-images', touch: true, minItems: 3, // use function to pull in initial value maxItems: 4 // use function to pull in initial value }); //mousewheel jQuery('.models-slider-shortcode .model-slider-thumbs').on('mousewheel', function (e) { var $carousel = jQuery(this); if (e.originalEvent.wheelDelta > 0) { $carousel.find('.flex-next').trigger('click'); } else { $carousel.find('.flex-prev').trigger('click'); } e.preventDefault(); e.stopPropagation(); }); var $introSlider = jQuery(".intro_section .flexslider"); $introSlider.each(function (index) { var $currentSlider = jQuery(this); var autoplay = $currentSlider.data('slideshow') ? $currentSlider.data('slideshow') : false; var slideshowSpeed = $currentSlider.data('slideshowspeed') ? $currentSlider.data('slideshowspeed') : 3000; $currentSlider.flexslider({ animation: "fade", pauseOnHover: true, slideshow: autoplay, useCSS: true, controlNav: true, directionNav: true, prevText: ">", nextText: "<", smoothHeight: false, slideshowSpeed: slideshowSpeed, animationSpeed: 600, start: function (slider) { slider.find('.slide_description').children().css({ 'visibility': 'hidden' }); slider.find('.flex-active-slide .slide_description').children().each(function (index) { var self = jQuery(this); var animationClass = !self.data('animation') ? 'fadeInRight' : self.data('animation'); setTimeout(function () { self.addClass("animated " + animationClass); }, index * 200); }); slider.find('.flex-control-nav').find('a').each(function () { jQuery(this).html('0' + jQuery(this).html()); }); }, after: function (slider) { slider.find('.flex-active-slide .slide_description').children().each(function (index) { var self = jQuery(this); var animationClass = !self.data('animation') ? 'fadeInRight' : self.data('animation'); setTimeout(function () { self.addClass("animated " + animationClass); }, index * 200); }); }, end: function (slider) { slider.find('.slide_description').children().each(function () { var self = jQuery(this); var animationClass = !self.data('animation') ? 'fadeInRight' : self.data('animation'); self.removeClass('animated ' + animationClass).css({ 'visibility': 'hidden' }); }); }, }) //wrapping nav with container .find('.flex-control-nav') .wrap('