Home  >  Article  >  Web Front-end  >  The previous and next keys on the keyboard are compatible with IE/google/firefox and other browsers_javascript skills

The previous and next keys on the keyboard are compatible with IE/google/firefox and other browsers_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:02:001198browse
Copy code The code is as follows:

< script language = "javascript" >
document. onkeydown = chang_page;
function chang_page(event) {
var event = event ? event : (window.event ? window.event : null);
var key = event.keyCode || event.which;
if (key == 37 || key == 33)
location = '';
if (key == 39 || key == 34)
location = '';
}
< / script >

Compatible with IE, google, firefox keyboard Previous Next
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn