Advertisement
thebys

Jquery arrow triggers

Mar 30th, 2014
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.52 KB | None | 0 0
  1. /**
  2.  * @author Thebys
  3.  */
  4. $(document).ready(function() {
  5.     $("#leftarrow").click(function() {
  6.         var radioButtons = $('input[name=slide]:checked').index();
  7.         var indexToSelect = parseFloat(radioButtons) - 2;
  8.         $("#sliderControl :eq(" + indexToSelect + ")").prop("checked", true);
  9.  
  10.     });
  11.     $("#rightarrow").click(function() {
  12.         var radioButtons = $('input[name=slide]:checked').index();
  13.         var indexToSelect = parseFloat(radioButtons) + 2;
  14.         $("#sliderControl :eq(" + indexToSelect + ")").prop("checked", true);
  15.     });
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement