MovingBoxes
MovingBoxes playground
HTML
<link rel="stylesheet" href="http://css-tricks.github.com/MovingBoxes/css/movingboxes.css">
<script src="http://css-tricks.github.com/MovingBoxes/js/jquery.movingboxes.js"></script>
<script src="http://css-tricks.github.com/MovingBoxes/js/jquery.easing.1.2.js"></script>
<!--[if lt IE 9]>
<link type="text/css" href="http://css-tricks.github.com/MovingBoxes/css/movingboxes-ie.css" rel="stylesheet" media="screen" />
<![endif]-->
<ul id="slider">
<li>
<img src="http://css-tricks.github.com/MovingBoxes/demo/1.jpg" alt="picture" />
<h2>Olivia News Heading</h2>
<p>A very short exerpt goes here... <a href="http://flickr.com/photos/justbcuz/112479862/">more</a></p>
</li>
<li>
<img src="http://css-tricks.github.com/MovingBoxes/demo/2.jpg" alt="picture" />
<h2>Alice News Heading</h2>
<p>A very short exerpt goes here... <a href="http://flickr.com/photos/joshuacraig/2698975899/">more</a> and a whole lot more text goes here, so we can see the height adjust.</p>
</li>
<li>
<img src="http://css-tricks.github.com/MovingBoxes/demo/3.jpg" alt="picture" />
<h2>Yin News Heading</h2>
<p>A very short exerpt goes here... <a href="http://flickr.com/photos/ruudvanleeuwen/468309897/">more</a></p>
</li>
<li>
<img src="http://css-tricks.github.com/MovingBoxes/demo/4.jpg" alt="picture" />
<h2>Gerri News Heading</h2>
<p>A very short exerpt goes here... <a href="http://flickr.com/photos/emikohime/294092478/">more</a></p>
</li>
<li>
<img src="http://css-tricks.github.com/MovingBoxes/demo/5.jpg" alt="picture" />
<h2>Tabitha News Heading</h2>
<p>A very short exerpt goes here... <a href="http://www.flickr.com/photos/fensterbme/499006584/">more</a></p>
</li>
<li>
<img src="http://css-tricks.github.com/MovingBoxes/demo/6.jpg" alt="picture" />
<h2>Mary News Heading</h2>
<p>A very...
CSS
#slider {
width: 300px;
}
#slider li {
width: 150px;
}
JavaScript
$('#slider').movingBoxes({
// **** Appearance ****
// start with this panel
startPanel: 1,
// non-current panel size: 80% of panel size
reducedSize: 0.8,
// if true, slider height set to max panel height;
// if false, height will auto adjust.
fixedHeight: false,
// **** Behaviour ****
// if true, movingBoxes will initialize, then animate into the
// starting slide (if not the first slide)
initAnimation: true,
// if true, movingBoxes will force the animation to complete
// immediately, if the user selects the next panel
stopAnimation: false,
// if true, hash tags are enabled
hashTags: true,
// if true, the panel will loop through the panels infinitely
wrap: false,
// if true, navigation links will be added
buildNav: true,
// function which returns the navigation text for each panel
navFormatter: function(index, panel) {
return "●" // bullets
},
// anything other than "linear" or "swing" requires the easing plugin
easing: 'swing',
// **** Times ****
// animation time in milliseconds
speed: 500,
// time to delay in milliseconds before MovingBoxes animates
// to the selected panel
delayBeforeAnimate: 0,
// **** Selectors & classes ****
// current panel class
currentPanel: 'current',
// added to the navigation, but the title attribute is blank unless
// the link text-indent is negative
tooltipClass: 'tooltip',
// class added to arrows that are disabled (left arrow when on first
// panel, right arrow on last panel)
disabled: 'disabled',
// **** Callbacks ****
// e = event, slider = MovingBoxes Object, tar = current panel #
// callback after the basic MovingBoxes structure has been built;
// before "initialized"
preinit: function(e, slider, tar) {},
// callback when MovingBoxes has completed initialization
initialized: function(e, slider, tar) {},
//...