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://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/ui-lightness/jquery-ui.css">
<ul id="slider">
    
    <li><button>test 1</button><a href="#1">test 1</a><input type="text"></li>
    
    <li><button>test 2</button><a href="#2">test 2</a><input type="text"></li>
    
    <li><button>test 3</button><a href="#3">test 3</a><input type="text"></li>
    
    <li><button>test 4</button><a href="#4">test 4</a><input type="text"></li>
    
    <li><button>test 5</button><a href="#5">test 5</a><input type="text"></li>
    
</ul>

<!-- Add stylesheets here -->
<link rel="stylesheet" href="http://proloser.github.com/AnythingSlider/css/theme-metallic.css">

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: 300px;
    height: 230px;
    list-style: none;
}

JavaScript

var setFocus = function(s) {
     // give focus to first item in the panel; this is also needed to make
     // sure the focusable item in a different panel doesn't still have focus
     s.$currentPage.find('a,input,textarea,select,button,area').eq(0).focus();
};

$('#slider').anythingSlider({

    // Callback when the plugin finished initializing
    onInitialized: function(e, slider) {
        slider.$items.filter(':not(.activePage)')
            .find('a,input,textarea,select,button,area').attr('tabindex', -1);
    },
    onSlideComplete: function(slider) {
        slider.$lastPage
            .find('a,input,textarea,select,button,area').attr('tabindex', -1);
        slider.$currentPage
            .find('a,input,textarea,select,button,area').removeAttr('tabindex');
    }

});