The code below shows how I created a "poor-man's" pager control that uses the 'goto' behavior.
var bc = $('#buttonContainer');
var $container = $('#container').cycle({
fx: 'scrollHorz',
speed: 300,
timeout: 0
});
$container.children().each(function(i) {
// create input
$('<input type="button" value="'+(i+1)+'" />')
// append it to button container
.appendTo(bc)
// bind click handler
.click(function() {
// cycle to the corresponding slide
$container.cycle(i);
return false;
});
});
|
|