Owl Carousel http://owlcarousel2.github.io/OwlCarousel2

Touch enabled jQuery plugin that lets you create beautiful responsive carousel slider.

Basic

Inverted

Add the .owl-carousel-inverted class to an .owl-carousel element to invert nav colors.

Center


Auto Width

Lazy Load

Video

Autoplay

Auto Height

Usage


require(['jquery', 'px-libs/owl.carousel'], function($) {
  ...
});
      

Usage

To use owl.carousel plugin, you need to include the next scripts:


<script src="path/to/js/libs/owl.carousel.js"></script>
<script src="path/to/js/pixeladmin/directives/angular-owl.carousel.js"></script>
      

Then inject the plugin into your angular application:

angular.module('yourApp', ['owl.carousel']);

Alternatively, you can include owl.carousel plugin using ocLazyLoad plugin:


$ocLazyLoad.load([
  {
    name: 'owl.carousel',
    files: [
      'path/to/js/libs/owl.carousel.js',
      'path/to/js/pixeladmin/directives/angular-owl.carousel.js',
    ],
  },
]);
      

owl-carousel directive

You can use owl-carousel directive where you want. And when the scope is destroyed the directive will be destroyed.

Methods

You can define methods attribute to get a pointer to owl.carousel instance methods (see the plugin's documentation):

  • add
  • next
  • play
  • prev
  • refresh
  • remove
  • replace
  • stop
  • to

<owl-carousel methods="ctrl.$carousel">...</owl-carousel>
      

function SomeController() {
  // Pointer
  this.$carousel = null;

  // ...

  // Then, after the initialization, you can call plugin methods:
  this.$carousel.prev([300]));
  this.$carousel.next([500]));
  this.$carousel.to([5, 300]));
});
      

Options

owl.carousel's options can be specified as attributes (see the plugin's documentation). All options expect an angular expression instead of a literal string.

Options marked with have an angular $watch listener applied to it.
  • animate-in
  • animate-out
  • auto-height
  • auto-height-class
  • auto-width
  • autoplay
  • autoplay-hover-pause
  • autoplay-speed
  • autoplay-timeout
  • center
  • dot-data
  • dots
  • dots-container
  • dots-each
  • dots-speed
  • drag-end-speed
  • fallback-easing
  • fluid-speed
  • free-drag
  • info
  • item-element
  • items
  • lazy-content
  • lazy-load
  • loop
  • margin
  • merge
  • merge-fit
  • mouse-drag
  • nav
  • nav-container
  • nav-element
  • nav-speed
  • nav-text
  • nested-item-selector
  • pull-drag
  • responsive
  • responsive-base-element
  • responsive-refresh-rate
  • rewind
  • rtl
  • slide-by
  • smart-speed
  • stage-element
  • stage-padding
  • start-position
  • touch-drag
  • url-hash-listener
  • video
  • video-height
  • video-width

<owl-carousel items="4"
              loop="true"
              responsive="{ 480: { items: 2 }, 600: { items: 4 } }"
              nav-element="'nav'">...</owl-carousel>
      

Events

Event handlers can be bound using attributes (see the plugin's documentation):

  • on-change
  • on-changed
  • on-drag
  • on-dragged
  • on-initialize
  • on-initialized
  • on-load-lazy
  • on-loaded-lazy
  • on-play-video
  • on-refresh
  • on-refreshed
  • on-resize
  • on-resized
  • on-stop-video
  • on-translate
  • on-translated

<owl-carousel on-changed="ctrl.changed"
              on-loaded-lazy="ctrl.loadedLazy"
              on-play-video="ctrl.playVideo">...</owl-carousel>
      

function SomeController() {
  this.changed = function(e) { ... }
  this.loadedLazy = function(e) { ... }
  this.playVideo = function(e) { ... }
});