stack-slider
v1.1.0
Published
Stacking Slider
Downloads
2
Maintainers
Readme
Stack Slider
JavaScript Stacking and unstacking slider.
Main
dist/
├── stackslider.css
├── stackslider.js
Getting started
Installation
npm i stack-slider
In browser:
<link href="/path/to/stackslider.css" rel="stylesheet">
<script src="/path/to/stackslider.js"></script>
Usage
Syntax
var container = document.getElementById('op-container');
new OPSlider(container, 1000);
element
- Type:
HTMLElement
- The target id of the slider.
- Type:
options
- Type:
Number
- Transition time in milliseconds
- Type:
Example
<section id="op-container">
<div class="op-wrapper">
<section id="slide-1" class="slide-item">
{{content}}
</section>
<section id="slide-2" class="slide-item">
{{content}}
</section>
</div>
</section>
/* Ensure the slider fits perfectly */
html,body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
Notes
- There should atleast be 2 items in the slider.
Browser support
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Opera (latest)
- Edge (latest)
- Internet Explorer 9+