( function( $ ) { 'use strict'; // Global var $win = $( window ), $doc = $( document ), $body = $( 'body' ); // owlCarousel function caliOwlCarousel() { if ( $.fn.owlCarousel ) { // Article Carousel/Slider $( '.js-mo-article-slider' ).each( function() { $( this ).owlCarousel({ loop: true, margin: 10, nav: false, dots: false, autoplay: true, autoplayHoverPause: true, responsiveClass: true, responsive:{ 0:{ items: 2, margin: 5 }, 768:{ items: 3, margin: 10 }, 1200:{ items: 4 } } }); } ); // need to add a class to the carousel item so it will be fetched by the carousel script // Owl's nestedItemSelector parameter only accepts Class name, in our case it's - 'mo-instagram-feed_el' $('.mo-instagram-feed .instagram-pics li').addClass('mo-instagram-feed_el'); $( '.js-mo-widget-instagram-feed' ).each( function() { $( this ).owlCarousel({ nestedItemSelector: 'mo-instagram-feed_el', loop: true, margin: 10, nav: false, dots: false, autoplay: true, autoplayHoverPause: true, responsive:{ 0:{ items: 3, margin: 0 }, 768:{ items: 4, margin: 0 }, 1200:{ items: 6, margin: 0 } } }); } ); // Append optional widget link to owl carousel item if ( $('.mo-instagram-feed .instagram-pics + p').length ) { $( '.mo-instagram-feed .instagram-pics + p' ).clone().appendTo( ".js-mo-widget-instagram-feed .mo-instagram-feed_el" ); } } } // Mobile Menu function mobileMenu() { // Mobile menu navigation toggle // Add .mobile-menu-active class to body when mobile menu is toggled // With that class hide/show mobile menu overlay $( '.site-header' ).on( 'click', '.mobile-menu-toggle', function( e ) { e.preventDefault(); $body.toggleClass( 'mobile-menu-active' ); } ); // Add dropdown arrow to