Skip to content

Instantly share code, notes, and snippets.

@pilt
Created July 5, 2011 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pilt/1064535 to your computer and use it in GitHub Desktop.
Save pilt/1064535 to your computer and use it in GitHub Desktop.
// Helper for history navigation. Links have
// href="#history-1" (or any other number).
$('a[href^="#history-"]').click(function() {
var idx = parseInt($(this).attr('href').split('-')[1], 10);
history.go(-idx);
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment