views:

178

answers:

2

Hello,

I am using the Jquery cycle plug in with the pager. I have a lot of items to page through. Is there a way I can add back and previous arrows to paginate the pager?

So I have like:

1 2 3 4 5 6 7 8 9

and I want the same but < 1 2 3 4 5 6 7 8 9 >

Is there an elegant way to code this? Many thanks for your help!

A: 

Sure, just use the prev and next parameters to specify which elements should be the next/prev buttons.

var $prev = $('<span id="prev">→</span>'),
    $next = $('<span id="next">←</span>'),
    $pager = $('<span id="pager" />');
$('foo').after($prev).after($pager).after($next).cycle({ prev: $prev, next: $next, pager: $pager });

Demo

Mathias Bynens
A: 

I do this on this site: http://www.naomimorgulis.com/

Basically when it reaches the end of the pager I dynamically generate a new set of pagers with thumbnails. I don't know if this is exactly elegant, but it works.

Nick