anonfagola
10 years ago
committed by
czaks
1 changed files with 32 additions and 30 deletions
@ -1,35 +1,37 @@ |
|||||
var hoverElem = null; |
if(active_page == "index" || active_page == "ukko"){ |
||||
|
var hoverElem = null; |
||||
$(document).mouseover(function(e){ |
|
||||
var x = e.clientX, y = e.clientY, |
$(document).mouseover(function(e){ |
||||
elementOnMouseOver = document.elementFromPoint(x, y); |
var x = e.clientX, y = e.clientY, |
||||
hoverElem = $(elementOnMouseOver); |
elementOnMouseOver = document.elementFromPoint(x, y); |
||||
}); |
hoverElem = $(elementOnMouseOver); |
||||
|
}); |
||||
$(document).keydown(function(e){ |
|
||||
//Up arrow
|
$(document).keydown(function(e){ |
||||
if(e.which == 38){ |
//Up arrow
|
||||
var ele = hoverElem; |
if(e.which == 38){ |
||||
var par = $(ele).parents('div[id^="thread_"]'); |
var ele = hoverElem; |
||||
|
var par = $(ele).parents('div[id^="thread_"]'); |
||||
if(par.length == 1){ |
|
||||
if(par.prev().attr("id") != null){ |
if(par.length == 1){ |
||||
if(par.prev().attr("id").match("^thread")){ |
if(par.prev().attr("id") != null){ |
||||
window.location.href = window.location.protocol+"//"+window.location.host+window.location.pathname+"#"+par.prev().attr("id"); |
if(par.prev().attr("id").match("^thread")){ |
||||
|
window.location.href = window.location.protocol+"//"+window.location.host+window.location.pathname+"#"+par.prev().attr("id"); |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
} |
//Down arrow
|
||||
//Down arrow
|
}else if(e.which == 40){ |
||||
}else if(e.which == 40){ |
var ele = hoverElem; |
||||
var ele = hoverElem; |
var par = $(ele).parents('div[id^="thread_"]'); |
||||
var par = $(ele).parents('div[id^="thread_"]'); |
|
||||
|
if(par.length == 1){ |
||||
if(par.length == 1){ |
if(par.next().attr("id") != null){ |
||||
if(par.next().attr("id") != null){ |
if(par.next().attr("id").match("^thread")){ |
||||
if(par.next().attr("id").match("^thread")){ |
window.location.href = window.location.protocol+"//"+window.location.host+window.location.pathname+"#"+par.next().attr("id"); |
||||
window.location.href = window.location.protocol+"//"+window.location.host+window.location.pathname+"#"+par.next().attr("id"); |
} |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
} |
}); |
||||
}); |
} |
||||
|
Loading…
Reference in new issue