Vue Flipster
Vue wrapper for coverflow library, jquery-flipster.
Requires jquery
. 😕
See the jquery-flipster demo here
Example
<cover-flow :loop="true" :autoplay="4000" theme="flat" :spacing="0" :buttons="true"> <cover-flow-slide> <img src="http://via.placeholder.com/500x500"> </cover-flow-slide> <cover-flow-slide> <img src="http://via.placeholder.com/500x500"> </cover-flow-slide> <cover-flow-slide> <img src="http://via.placeholder.com/500x500"> </cover-flow-slide> <cover-flow-slide> <img src="http://via.placeholder.com/500x500"> </cover-flow-slide> <cover-flow-slide> <img src="http://via.placeholder.com/500x500"> </cover-flow-slide></cover-flow>
Installation
npm install vue-flipster --save // or yarn add vue-flipster
Vue Vue
You should also be sure you require jquery
, jquery.flipster
, and jquery.flipster
css in your project.
Wherever you bootstrap your application
In your css build process;
Installing without a build process
See demo/index.html
for use basic script file based setup.
Options
All jquery-flipster options have matching props with the exception of item-container
and item-selector
, which are decided by the plugin.
The style
option prop has been changed to theme
to avoid conflict with the DOM style
attribute.
// ['center'|number] // Zero based index of the starting item, or use 'center' to start in the middle start: { return 'center' } // [milliseconds] // Speed of the fade in animation after items have been setup fadeIn: { return 400 } // [true|false] // Loop around when the start or end is reached loop: { return false } // [false|milliseconds] // If a positive number, Flipster will automatically advance to next item after that number of milliseconds autoplay: { return false } // [true|false] // If true, autoplay advancement will pause when Flipster is hovered pauseOnHover: { return true } // [coverflow|carousel|flat|...] // Adds a class (e.g. flipster--coverflow) to the flipster element to switch between display styles // Create your own theme in CSS and use this setting to have Flipster add the custom class theme: { return 'coverflow' } // [number] // Space between items relative to each item's width. 0 for no spacing, negative values to overlap spacing: { return -06 } // [true|false] // Clicking an item switches to that item click: { return true } // [true|false] // Enable left/right arrow navigation keyboard: { return true } // [true|false] // Enable mousewheel/trackpad navigation; up/left = previous, down/right = next scrollwheel: { return true } // [true|false] // Enable swipe navigation for touch devices touch: { return true } // [true|false|'before'|'after'] // If not false, Flipster will build an unordered list of the items // Values true or 'before' will insert the navigation before the items, 'after' will append the navigation after the items nav: { return false } // [true|false|'custom'] // If true, Flipster will insert Previous / Next buttons with SVG arrows // If 'custom', Flipster will not insert the arrows and will instead use the values of `buttonPrev` and `buttonNext` buttons: { return true } // [text|html] // Changes the text for the Previous button buttonPrev: { return 'Previous' } // [text|html] // Changes the text for the Next button buttonNext: { return 'Next' }
Events
switch
: The slide has changed.