Skip to content

Instantly share code, notes, and snippets.

@lewisnyman
Created November 9, 2015 13:37
Show Gist options
  • Save lewisnyman/d81be1765689563564bf to your computer and use it in GitHub Desktop.
Save lewisnyman/d81be1765689563564bf to your computer and use it in GitHub Desktop.
A JS file to initialise flexslider.js in Drupal 8
(function ($, Drupal) {
'use strict';
/**
* Initialise the flexslider JS.
*/
Drupal.behaviors.felxsliderInit = {
attach: function (context, settings) {
var slider = $(context).find('.js-slider');
if (slider.length) {
$(slider).flexslider({
animation: "slide",
selector: ".homepage__slider .slider__slide"
});
}
}
};
})(jQuery, Drupal);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment