开发者

cycle next and previous based on position function?

i know how to call prev/next normally but i want it to open the next slide if the mouse is over half way of the screen and previous if less then half way over.

can't seem to find $.cycle.next() or similar. Any ideas welcome...!

ie

$('div.pageImages').cycle({
        height  :   '600px',
        width   :   '600px',
        timeout :   0,
        speed   :   400,
        before  :   onBefore,
        after   :   onAfter

    });  

$('div.pageImages img').bind('click',function(e)开发者_开发知识库{
    var ww = $(window).width();
    if(!$(this).attr('href')) $()(e.pageX < (ww/2) ? **CYCLE_PREVIOUS** : **CYCLE_NEXT**);
    alert(e.pageX);

});


ok - this worked! need v2.88 of cycle

$('#pageImages').cycle({
            height  :   '600px',
            width   :   '600px',
/*          next    :   'div.pageImages', */
            timeout :   0,
            speed   :   400,
            before  :   onBefore,
            after   :   onAfter

        });

        $('div.pageImages img').bind('click',function(e){
            var ww = $(window).width();
            if(!$(this).attr('href')) $(e.pageX < (ww/2) ? $('#pageImages').cycle('prev') : $('#pageImages').cycle('next'));
        });
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜