Sha256: 4aee9e569ba849b2f49c2c265ac2d23cd9848e514135628f2b2a7029d163f3be
Contents?: true
Size: 1.41 KB
Versions: 54
Compression:
Stored size: 1.41 KB
Contents
/** * Carousel Materialize wrapper. * * @author Htmlstream * @version 1.0 * @requires * */ ;(function ($) { 'use strict'; $.HSCore.components.HSCarouselMaterialize = { /** * * * @var Object _baseConfig */ _baseConfig: { dist: -50 }, /** * * * @var jQuery pageCollection */ pageCollection: $(), /** * Initialization of Carousel wrapper. * * @param String selector (optional) * @param Object config (optional) * * @return jQuery pageCollection - collection of initialized items. */ init: function (selector, config) { this.collection = selector && $(selector).length ? $(selector) : $(); if (!$(selector).length) return; this.config = config && $.isPlainObject(config) ? $.extend({}, this._baseConfig, config) : this._baseConfig; this.config.itemSelector = selector; this.initCarouselMaterialize(); return this.pageCollection; }, initCarouselMaterialize: function () { //Variables var $self = this, config = $self.config, collection = $self.pageCollection; //Actions this.collection.each(function (i, el) { //Variables var $this = $(el); $this.materializeCarousel({ dist: -50 }); //Actions collection = collection.add($this); }); } } })(jQuery);
Version data entries
54 entries across 54 versions & 1 rubygems