7.6.js 549 B

12345678910111213141516171819
  1. $(document).ready(function() {
  2. var $books = $('#books').cycle({
  3. timeout: 2000,
  4. speed: 200,
  5. pause: true
  6. });
  7. if ( $.cookie('cyclePaused') ) {
  8. $books.cycle('pause');
  9. }
  10. var $controls = $('<div id="books-controls"></div>').insertAfter($books);
  11. $('<button>Pause</button>').click(function(event) {
  12. event.preventDefault();
  13. $books.cycle('pause');
  14. }).appendTo($controls);
  15. $('<button>Resume</button>').click(function(event) {
  16. event.preventDefault();
  17. $('ul:paused').cycle('resume');
  18. }).appendTo($controls);
  19. });