<!-- The HTML -->
<a class="unslider-arrow prev" href="#">Previous slide</a>
<a class="unslider-arrow next" href="#">Next slide</a>
<!-- And the JavaScript -->
<script type="text/javascript">// <![CDATA[
var unslider = $('.banner').unslider();
$('.unslider-arrow').click(function() {
var fn = this.className.split(' ')[1];
// Either do unslider.data('unslider').next() or .prev() depending on the className
unslider.data('unslider')[fn]();
});
// ]]></script>
访问unslider性质以及更多:
var slidey = $('.banner').unslider(),
data = slidey.data('unslider');
// Start Unslider
data.start();
// Pause Unslider
data.stop();
// Move to a slide index, with optional callback
data.move(2, function() {});
// data.move(0);
// Manually enable keyboard shortcuts
data.keys();
// Move to the next slide (or the first slide if there isn't one)
data.next();
// Move to the previous slide (or the last slide if there isn't one)
data.prev();
// Append the navigation dots manually
data.dots();