SerialScroll_right-to-left.js 984 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*!******************************************
  2. Snippet for jQuery.SerialScroll
  3. --Right to left (or bottom to top) animation--
  4. Suppose an HTML like this:
  5. ...
  6. <div id="pane">
  7. <ul>
  8. <li><img src="..." /></li>
  9. <li><img src="..." /></li>
  10. <li><img src="..." /></li>
  11. <li><img src="..." /></li>
  12. <li><img src="..." /></li>
  13. </ul>
  14. </div>
  15. ...
  16. You can use just divs or any other HTML, just
  17. setup the selectors to match the elements.
  18. Note that to make this botton to top you just
  19. set the option 'axis' to 'y'.
  20. *********************************************/
  21. jQuery(function( $ ){
  22. var $pane = $('#pane'), //the item being scrolled
  23. $items = $pane.find('li');//the items, don't need to be LI
  24. $('#pane').serialScroll({
  25. //...
  26. items: $items, //or just 'li'
  27. start: $items.length - 1, //start with the last one
  28. force: true, //force an initial scroll to the last
  29. step: -1, //more backwards, one on one (can be another number)
  30. //...
  31. });
  32. });