Source code of Leftypol imageboard
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

37 lines
875 B

if(active_page == "index" || active_page == "ukko"){
var hoverElem = null;
$(document).mouseover(function(e){
var x = e.clientX, y = e.clientY,
elementOnMouseOver = document.elementFromPoint(x, y);
hoverElem = $(elementOnMouseOver);
});
$(document).keydown(function(e){
//Up arrow
if(e.which == 38){
var ele = hoverElem;
var par = $(ele).parents('div[id^="thread_"]');
if(par.length == 1){
if(par.prev().attr("id") != null){
if(par.prev().attr("id").match("^thread")){
par.prev()[0].scrollIntoView(true);
}
}
}
//Down arrow
}else if(e.which == 40){
var ele = hoverElem;
var par = $(ele).parents('div[id^="thread_"]');
if(par.length == 1){
if(par.next().attr("id") != null){
if(par.next().attr("id").match("^thread")){
par.next()[0].scrollIntoView(true);
}
}
}
}
});
}