How to use owl carousel in custom module? I am trying to call Owl Carousel from a custom module, but despite the short description of how to do that on https://www.drupal.org/node/2412689, can't figure out. 

I could use Views, but then I need to call either list of nodes or node fields, but in this case, I have several items which need to be rotated in a variable. I could put them into array if the implementation requires it.

So basically my question is:

Given a list of items in a variable (or array) how can I rotate them using the Owl Carousel module?
Assuming you've an array, you can print the array items one by one in wrapper &lt;div&gt; tag, and apply Own Carousel to wrapper &lt;div&gt; tag (check owl-demo class in example below). To do this in Drupal, you can process your array in your module to create HTML, and apply JS using drupal_add_js(). To print HTML you can either create a custom block and show on page or create custom page.

Implementing in Drupal with custom module:

function _owl_carousel_demo() {
  $array = array('User 1', 'User 2', 'User 3', 'User 4', 'User 5', 'User 6', 'User 7');
  $output = '&lt;div id="owl-demo" class="owl-carousel"&gt;';
  foreach ($array as $value) {
    $output .= '&lt;div class="item"&gt;&lt;h1&gt;' . $value . '&lt;/h1&gt;&lt;/div&gt;';
  }
  $output .= '&lt;/div&gt;';
  $output .= '&lt;div class="customNavigation"&gt;
    &lt;a class="btn prev"&gt;Previous&lt;/a&gt;
    &lt;a class="btn next"&gt;Next&lt;/a&gt;
    &lt;a class="btn play"&gt;Autoplay&lt;/a&gt;
    &lt;a class="btn stop"&gt;Stop&lt;/a&gt;
  &lt;/div&gt;&lt;/div&gt;';

  drupal_add_css('http://owlgraphic.com/owlcarousel/owl-carousel/owl.carousel.css', 'external');
  drupal_add_js('http://owlgraphic.com/owlcarousel/owl-carousel/owl.carousel.js', 'external');
  drupal_add_js('jQuery(document).ready(function() {
      var owl = jQuery("#owl-demo");
      owl.owlCarousel({
        items : 4,
      });
    });', 'inline');

  return $output;
}


Below example shows complete HTML:

&lt;html&gt;
  &lt;head&gt;
    &lt;link href="http://owlgraphic.com/owlcarousel/owl-carousel/owl.carousel.css" rel="stylesheet"&gt;
    &lt;link href="http://owlgraphic.com/owlcarousel/owl-carousel/owl.theme.css" rel="stylesheet"&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;?php $array = array('User 1', 'User 2', 'User 3', 'User 4', 'User 5', 'User 6', 'User 7'); ?&gt;
    &lt;div id="demo"&gt;
      &lt;div class="container"&gt;
        &lt;div class="row"&gt;
          &lt;div class="span12"&gt;
            &lt;div id="owl-demo" class="owl-carousel"&gt;
              &lt;?php foreach ($array as $value) : ?&gt;
                &lt;div class="item"&gt;&lt;h1&gt;&lt;?php echo $value; ?&gt;&lt;/h1&gt;&lt;/div&gt;
              &lt;?php endforeach; ?&gt;
            &lt;/div&gt;
            &lt;div class="customNavigation"&gt;
              &lt;a class="btn prev"&gt;Previous&lt;/a&gt;
              &lt;a class="btn next"&gt;Next&lt;/a&gt;
              &lt;a class="btn play"&gt;Autoplay&lt;/a&gt;
              &lt;a class="btn stop"&gt;Stop&lt;/a&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;script src="http://owlgraphic.com/owlcarousel/assets/js/jquery-1.9.1.min.js"&gt;&lt;/script&gt;
    &lt;script src="http://owlgraphic.com/owlcarousel/owl-carousel/owl.carousel.js"&gt;&lt;/script&gt;
    &lt;script&gt;
    $(document).ready(function() {
      var owl = $("#owl-demo");
      owl.owlCarousel({
        items : 4, //10 items above 1000px browser width
      });
      // Custom Navigation Events
      $(".next").click(function(){
        owl.trigger('owl.next');
      })
      $(".prev").click(function(){
        owl.trigger('owl.prev');
      })
      $(".play").click(function(){
        owl.trigger('owl.play',1000);
      })
      $(".stop").click(function(){
        owl.trigger('owl.stop');
      })
    });
    &lt;/script&gt;
  &lt;/body&gt;
&lt;/html&gt;