Skip to content

Instantly share code, notes, and snippets.

@wpexplorer
Created January 11, 2019 22:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpexplorer/efaff7ba406bd65cbeee6561e05c24a2 to your computer and use it in GitHub Desktop.
Save wpexplorer/efaff7ba406bd65cbeee6561e05c24a2 to your computer and use it in GitHub Desktop.
( function( $ ) {
'use strict';
function yourCustomCarousels {
// Make sure scripts are loaded
if ( undefined === $.fn.wpexOwlCarousel || undefined === $.fn.imagesLoaded ) {
return;
}
$( '.your-custom-carousels', $context ).each( function() {
var $this = $( this ),
$data = $this.data();
$this.imagesLoaded( function() {
var owl = $this.wpexOwlCarousel( {
animateIn : false,
animateOut : false,
lazyLoad : false,
dots : true,
nav : false
} );
} );
} );
}
$( document ).ready(function() {
yourCustomCarousels();
} );
} ) ( jQuery );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment