Created
November 9, 2015 13:37
-
-
Save lewisnyman/d81be1765689563564bf to your computer and use it in GitHub Desktop.
A JS file to initialise flexslider.js in Drupal 8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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