views:

828

answers:

2

I I want to load a Jquery Cycle slideshow and after loading pause until the user clicks the Play button. I am new to Jquery so could you give me a detailed explanation and possibly example code. You can see my slideshow @ www.sessomsphotographics.com

Thank you

+1  A: 

You can send the string 'pause' to the cycle plugin to pause it, and then send in 'resume' to resume it.

// start cycle with default options
$('#rotator').cycle();

// immediately pause it
$('#rotator').cycle('pause');

// when the play button is clicked, resume
$('#play-button').click(function (event) {
    event.preventDefault();
    $('#rotator').cycle('resume');
});
bdukes
Thanks this worked but I have to double click the play link to start the slide show which is coded to toggle from play to pause. below is the code I tried.
$(document).ready(function() { $('.slideshow').cycle({ fx: 'fade', timeout: 4000, speed: 500, delay: 0, pager: '#pager', prev: '#prev', next: '#next', pause: 1, fit: 1 }); $('#playControl').click(function () { $('#playControl').toggle( function() { $('.slideshow').cycle('pause'); $(this).text('Play'); }), function() { $('.slideshow').cycle('resume'); $(this).text('Pause'); } }); });
A: 

You can send it the 'pause' message on ready:

$(document).ready(function() {         
    $('.slideshow').cycle('pause'); 
    });
});
superUntitled
Thanks This also worked. I am still having a bit of a problem. See my comments above.