Skip to content

Instantly share code, notes, and snippets.

@pommiegranit
Created September 8, 2014 07:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pommiegranit/9e2e4655bf9ca09b54b3 to your computer and use it in GitHub Desktop.
Save pommiegranit/9e2e4655bf9ca09b54b3 to your computer and use it in GitHub Desktop.
Initialization script for Tocca js in WordPress
jQuery(document).ready(function($){
$(gestures.container).on('dbltap', function(){
jQuery(location).attr('href', gestures.destination );
}
).on('swipeleft', function() {
var post_nav = jQuery('link[rel="next"]');
if ( post_nav ) {
jQuery(location).attr('href', post_nav.attr('href'));
}
}
).on('swiperight', function() {
var post_nav = jQuery('link[rel="prev"]');
if ( post_nav ) {
jQuery(location).attr('href', post_nav.attr('href'));
}
}
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment