Skip to content

Instantly share code, notes, and snippets.

@imzhi
Created March 27, 2015 14:19
Show Gist options
  • Save imzhi/0e71f97090a7abb080ad to your computer and use it in GitHub Desktop.
Save imzhi/0e71f97090a7abb080ad to your computer and use it in GitHub Desktop.
风之动漫键盘翻页插件
// ==UserScript==
// @name 风之动漫键盘翻页插件
// @namespace http://your.homepage/
// @version 0.1
// @description 风之动漫键盘翻页插件,左右键控制漫画翻页
// @author imzhi
// @match http://manhua.fzdm.com/*
// @grant none
// ==/UserScript==
$(function() {
$("body").keydown(function(evt) {
// 左 37 右 39
var prev = $(".navigation").find(":contains('上一页')")[0];
var next = $(".navigation").find(":contains('下一页')")[0];
if (evt.keyCode==37 && prev) {
prev.click();
} else if (evt.keyCode==39 && next) {
next.click()
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment