0

This question already has an answer here:

I have some javascript code (as listed below) that I once used on a different non-drupal site. I would like to implement the same code on my custom theme. my research says i need to use drupal.behavious. I need a guide on how to go about this in Drupal.

$(document).ready(function()
{
    "use strict";

        if($('.recent_slider').length)
        {
            var recentSlider = $('.recent_slider');
            recentSlider.owlCarousel(
            {
                items:3,
                autoplay:false,
                loop:true,
                smartSpeed:1200,
                nav:false,
                dots:false,
                responsive:
                {
                    0:
                    {
                        items:1
                    },
                    991:
                    {
                        items:2
                    },
                    1199:
                    {
                        items:3
                    }
                }
            });
        }

});

marked as duplicate by Clive theming Feb 7 at 10:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Welcome to Drupal Answers :) We don't write guides here, just answer very specific narrowly-scope questions. Fortunately, we have a question with some useful answers on it already (see the duplicate linked above), and the entire API is well documented anyway: drupal.org/docs/8/api/javascript-api/javascript-api-overview – Clive Feb 7 at 10:54

Browse other questions tagged or ask your own question.