开发者

how to block cycle on many elements

I have this kind of jquery cycle handling 2 elements (#rotator1, #rotator2) :

    $("#rotator1, #rotator2").cycle(
        {
            fx: 'fade',
            sync: 1,
            speed: 800,
            prev: '#headerButtonBack',
            next: '#headerButtonNext',                
            timeout: 4000,
            pause: 1
        }
    );

and开发者_JAVA百科 I'd like, when a user is on #rotator1 with mouse (mouseover), block also the cycle of the #rotator2.

Is it possible? How? Thanks


Give both slideshow a certain class (i used pics);

On hover you can do something like:

$('#rotator1, #rotator2').hover(function() {
    $('.pics').cycle('pause'); return false;
}, function() {
    $('.pics').cycle('resume'); return false;
 });

There is a jsfiddle: http://jsfiddle.net/psxgT/1/


Did you read the documentation?

Here it is mentioned that when you will set the value of pause to 1 then it will enable "pause on hover"

If some functionality is offered by default, you should not write your own code.

Best.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜