1.2.1 • Published 9 years ago

vigour-carousel v1.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

carousel

js-standard-style npm version Build Status

An infinite carousel for usage with vigour-element.

how to use

npm i --save vigour-carousel

Add the carousel to your app as a component, define the $collection for it's items and add the data.

The carousel exposes .next() and .previous() methods.

##setup

var e = require('vigour-element')
var carousel = require('vigour-carousel')

// define some data
var Observable = require('vigour-observable')
var Data = new Observable({
  inject: require('vigour-observable/lib/data'),
  Child: 'Constructor'
}).Constructor

// it expects a "focus" field (this will be used to store the current slide)
var carouselData = new Data({
  focus: 0,
  0:{},
  1:{},
  2:{},
  3:{}
})

// add carousel component to your app
var app = e({
  components: {
    carousel: carousel
  },
  DOM: document.body
})

// add your carousel
app.set({
  myCarousel: {
    type: 'carousel',
    items:{
      $collection: true
    }
  }
})

// add data to app
app.val = carouselData
1.2.1

9 years ago

1.2.0

9 years ago

1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago