开发者

Jcycle END callback with call

Hi guys I just wanna know if it's possible to refresh my cycle elements at the end of the cycle to go get data from a php page without refreshing the page...

I try this but it's not working at all...

$('#thicker').load('thicker.php', function() {
  $('#thicker').cycle({ 
    fx:    'fade', 
    speed: 'slow',
    timeout: 6000,
    end: function() {  
        alert("End")
        $('#thicker').fadeOut("slow").load('thicker.php').fadeIn("slow");
    } 
});

it load my data from my php page the first time but at the e开发者_Python百科nd of the cycle when all my elements have cycle it dosent go get the new data from the php and it dosent even do the alert...

Is there anyone have a solution? thanks!


The default behavior of the cycle plugin is to loop forever so your end callback will never get called. You want to specify autostop: true or nowrap: true. From the fine manual:

autostop: 0,     // true to end slideshow after X transitions (where X == slide count) 
// ...
end:      null,  // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options) 
// ...
nowrap:   0,     // true to prevent slideshow from wrapping 

So try adding autostop:true or nowrap:true to your .cycle() options, that should get your end callback called.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜