aboutsummaryrefslogtreecommitdiffstats
path: root/template/standard/rsrc/main.js
blob: b5d1530183e116495acaa07d9c9ae6efb2bcb23c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//==============================================================================
// Elements which contains the location of the previous and next site
//==============================================================================
var prev = document.getElementById("prev-site");
var next = document.getElementById("next-site");

//==============================================================================
// Handle arrow keys and change the location to the desired direction
//==============================================================================
document.addEventListener("keyup", function(event) {
	if(!event.ctrlKey && !event.shiftKey) {
		(event.keyCode === 37 && prev) && (window.location.href = prev.getAttribute("href"));
		(event.keyCode === 39 && next) && (window.location.href = next.getAttribute("href"));
	}
}, false);