JQuery Cycle plugin - pageAnchorBuilder using radio buttons

Posted by Josh on Stack Overflow See other posts from Stack Overflow or by Josh
Published on 2011-02-02T23:20:25Z Indexed on 2011/02/02 23:25 UTC
Read the original article Hit count: 325

Hi all,

JQuery noobie here - i'm trying to make a pager using radio buttons with the JQuery Cycle pageAnchorBuilder.

The transitions all seem to work ok, except but it is not possible to select a radio button. Any help much appreciated!

Cheers

Here is my JavaScript code:

$('.products').cycle({
    fx: 'scrollHorz',
    speed:  300,
    timeout: 0,
    pager: '#nav',

    pagerAnchorBuilder: function(idx, slide) {
     return '#nav input:eq(' +idx +')';

} 
});

HTML is here:

<ul id="nav">
    <li><input type="radio" name="style" id="style1" value="Style 1" /><label for="style1">Style 1</label></li>
    <li><input type="radio" name="style" id="style2" value="Style 2" /><label for="style2">Style 2</label></li>
    <li><input type="radio" name="style" id="style3" value="Style 3" /><label for="style3">Style 3</label></li>
</ul>

© Stack Overflow or respective owner

Related posts about jquery-plugins

Related posts about radio-button