Continuing experiments with my own slider. Now making nav arrows. So Im asking how to make it work? I’m using next()/prev() to make next/prev input checkbox to be checked. But next()/prev() isn’t working. Why? Here is the code.
$('.to-right').click(function(){
$('input[type="radio"]:checked').next('input[type="radio"]').prop("checked", true)
});
$('.to-left').click(function(){
$('input[type="radio"]:checked').prev('input[type="radio"]').prop("checked", true)
});
.next()so your code
$('input[type="radio"]:checked').next('input[type="radio"]')will not get the next radio button.you can try :
same with
.prev()======================================================
add class
firstandlastto the first and last radioand hide the
to-leftnav at firstcheck this DEMO