The setup.
Include jquery.skippr.css inside your head tag and skippr.js just before the closing body tag.
Be sure to include jQuery before skippr.js
<head>
<title>Your Awesome Website</title>
<link rel="stylesheet" href="your-path-to-skippr.css">
</head>
<body>
<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="your-path-to-skippr.js"></script>
</body>
Create a target element with divs inside, one for each slide, and add a background image with css or the style attribute. Skippr targets div tags inside of the selected element with background-images applied to them. Put this target element inside of a container element styled and positioned to your liking. The target element will completely fill it's parent container element.
**Note: The container element must have a specified width and height, and position other than static to work properly.
<div id="container">
<div id="theTarget">
<div style="background-image: url(img/image1.jpg)"></div>
<div style="background-image: url(img/image2.jpg)"></div>
<div style="background-image: url(img/image3.jpg)"></div>
<div style="background-image: url(img/image4.jpg)"></div>
<div style="background-image: url(img/image5.jpg)"></div>
</div>
</div>
Initiate.
Just select the target element with jQuery and call the skippr method. Thats it!
$(document).ready(function(){
$("#theTarget").skippr();
});
Options.
Pass in an options object as a parameter to the skippr method for customization.
// Defaults
$("#theTarget").skippr({
transition: 'slide',
speed: 1000,
easing: 'easeOutQuart',
navType: 'block',
childrenElementType: 'div',
arrows: true,
autoPlay: false,
autoPlayDuration: 5000,
keyboardOnAlways: true,
hidePrevious: false
});
Skippr will be an ongoing project. Check back or star on Github for updates =]