键盘上一张下一张兼容IE/google/firefox等浏览器

内容摘要
复制代码 代码如下: < script language = "javascript" > document.onkeydown = chang_page; function chang_page(event) { var event = event ? event : (window.event ?
文章正文
复制代码 代码如下:

< 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 >

兼容IE,google,firefox的键盘上一张下一张
代码注释

作者:喵哥笔记

IDC笔记

学的不仅是技术,更是梦想!