Skip to content

Instantly share code, notes, and snippets.

@guizmo
Created May 22, 2012 00:08
Show Gist options
  • Save guizmo/2765583 to your computer and use it in GitHub Desktop.
Save guizmo/2765583 to your computer and use it in GitHub Desktop.
Next and Prev Counter
$("#prev").click(function(){
count--;
if(count < 0) count = $("li .tpl").length - 1;
$("li .tpl")[count].click();
});
$("#next").click(function(){
count++;
if(count > $("li .tpl").length - 1) count = 0;
$("li .tpl")[count].click();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment