<script type='text/javascript'>
$(document).ready(function(){
	$(this).keypress(function(e) {
		var code = e.keyCode;
		var url = window.location.href;
		var part = url.split('=');
		var page;
		if (code == 39) { //right
			page = parseInt(part[1]) + 1;
		}
		if (code == 37) { //left
			page = parseInt(part[1]) - 1;
		}
		$(location).attr('href', part[0] + '=' + page);
	});
});
</script>
Published in: JavaScript
Download

Related snippets