12345678910111213141516171819202122232425262728293031323334353637 |
- $(document).ready(function() {
- var $books = $('#books').cycle({
- timeout: 2000,
- speed: 200,
- pause: true
- });
- if ( $.cookie('cyclePaused') ) {
- $books.cycle('pause');
- }
- var $controls = $('<div id="books-controls"></div>').insertAfter($books);
- $('<button>Pause</button>').click(function(event) {
- event.preventDefault();
- $books.cycle('pause');
- $.cookie('cyclePaused', 'y');
- }).appendTo($controls);
- $('<button>Resume</button>').click(function(event) {
- event.preventDefault();
- $('ul:paused').cycle('resume');
- $.cookie('cyclePaused', null);
- }).appendTo($controls);
- $books.hover(function() {
- $books.find('.title').animate({
- backgroundColor: '#eee',
- color: '#000'
- }, 1000);
- }, function() {
- $books.find('.title').animate({
- backgroundColor: '#000',
- color: '#fff'
- }, 1000);
- });
- $('h1').click(function() {
- $(this).toggleClass('highlighted', 'slow');
- });
- });
|