7.4.js 475 B

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