1.2.2 • Published 5 years ago

minsky-carousel v1.2.2

Weekly downloads
9
License
ISC
Repository
bitbucket
Last release
5 years ago

Carousel

A content carousel based on Swiper

Everybody loves carousels. This class is pretty much plug and play for any type of content. Enjoy our PeireMeulen!

Class type: Component

Dependencies

  • Component 1.0.0

Getting started

First wait until Swiper is loaded, then pass the parent of the content. For a full list of possible settings: https://idangero.us/swiper/api/#parameters

Javascript

import Carousel from 'minsky-carousel';

const carousel = new Carousel({
    el: [DOM ELEMENT],
    settings: {
        property: value
    }
});

SCSS

@import 'minsky-carousel/css/carousel.scss';

Constructor Parameters

args

Type: Object Default: {}

Config options that will be used when instance is created

objectName

Type: String Default: 'Carousel'

Object name that will be used as recognisable identifier and as prefix in logs


Interface

Methods

setSettings

Parameters: settings:object, autoReInnit:Boolean = true Return: self

Applies given settings to swiper by merging it with the params property. It’ll automatically re-innit the swiper instance when not specified otherwise

next

Parameters: [ none ] Return: self

Slides to next slide

previous

Parameters: [ none ] Return: self

Slides to previous slide

refresh

Parameters: [ none ] Return: self

Refreshes the swiper instance

Destroy

Parameters: [ none ] Return: undefined

Removes every trace of Swiper and puts everything back to normal


To Do

  • Move mergeObjects and mergeArrays methods outside of the class definition
  • See if general class can be used over extentions so has-control-modifiers don’t need to be defined every time the object name changes.

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago