Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQUERY CYCLE - Can I add page links to anchors assigned to Cycle's pager?

Seems I've outdone myself. All the while I was creating this pretty little 'latest news' widget that fades on mouseover of each anchor. Then my colleague says, "Hey, Chris, these links don't work"

...oops. I would like to find out if I can have these anchors take the user to the relvent page on click. Currently Cycle is set to do its hocus pocus on mouseover.

This is my Cycle code:

$('#newsSlider .slides ul').cycle({
    fx:     'fade',
    speed:  1000,
    timeout: 0,
    pager:  '.slides-nav',
    pagerEvent: 'mouseover',
    pagerAnchorBuilder: function(idx, slide) {
        // return sel string for existing anchor
        return '.slides-nav li:eq(' + (idx) + ') a';
    }

Any help would be hugely appriciated. Thanks everyone!

Christian

like image 674
christianDuncan Avatar asked Dec 30 '22 00:12

christianDuncan


1 Answers

I will be releasing a new version today that fixes this problem, but in the meantime you can comment out these two lines in the plugin:

if (opts.pagerEvent != 'click')
    $a.click(function(){return false;});

Mike

like image 53
malsup Avatar answered Dec 31 '22 13:12

malsup