AnythingSlider playground

Add, remove, adjust any or all options so you can see how it works.

by Mottie

HTML

<link rel="stylesheet" href="http://css-tricks.github.com/AnythingSlider/css/anythingslider.css">
<script src="http://css-tricks.github.com/AnythingSlider/js/jquery.anythingslider.js"></script>
<script src="http://css-tricks.github.com/AnythingSlider/js/jquery.easing.1.2.js"></script>
<script src="http://css-tricks.github.com/AnythingSlider/js/swfobject.js"></script>
<script src="http://css-tricks.github.com/AnythingSlider/js/jquery.anythingslider.fx.js"></script>
<script src="http://css-tricks.github.com/AnythingSlider/js/jquery.anythingslider.video.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css">
<script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
<!DOCTYPE html>
<html>

    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>AnythingSlider</title>
        <link rel="stylesheet" href="http://css-tricks.github.com/AnythingSlider/css/anythingslider.css" />
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
        <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
        <script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
        <script src="http://css-tricks.github.com/AnythingSlider/js/jquery.anythingslider.js"></script>
    </head>

    <body>

        <div data-role="page">

            <div data-role="header">
                <h1>AnythingSlider</h1>
            </div><!-- /header -->

            <div data-role="content">
                <ul id="slider">
                    <li><img src="http://placekitten.com/220/200" alt="" /></li>
                    <li><img src="http://placehold.it/220x200" alt="" /></li>
                    <li><img src="http://placebear.com/220/200" alt="" /></li>
                    <li><img src="http://lorempixel.com/220/200" alt="" /></li>
                 ...

CSS

/*** Set Slider dimensions here! Version 1.7+ ***/
/* added #slider li to make panels the same size in case "resizeContents" is false */
ul#slider, ul#slider li {
    width: 220px;
    height: 200px;
    list-style: none;
}

JavaScript

/* 
  You'll need to test this demo on a mobile device
  jQuery Mobile 1.1.1 css & js loaded in the resources
*/
$(function(){
$('#slider').anythingSlider({

    // Callback when the plugin finished initializing
    onInitialized: function(e, slider) {
        slider.$window
            .bind('swiperight', function() {
                slider.goForward();
            })
            .bind('swipeleft', function() {
                slider.goBack();
            });
    }

});});