🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Greasy Fork is available in English.

动漫屋翻页快捷键

方向键[→]下一页,方向键[←]上一页

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name         动漫屋翻页快捷键
// @namespace    https://greasyfork.org/zh-CN/users/4330
// @version      0.3
// @description  方向键[→]下一页,方向键[←]上一页
// @author       x2009again
// @match        http://www.dm5.com/*
// @exclude      http://www.dm5.com/manhua-*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function HiddenComment(evt){//隐藏评论
        event=evt;
        window.localStorage.setItem("dm5_HiddenComment","1");
        $("div.view-comment").remove();
        $(event.target).off().on("click",ShowComment).text("显示评论");
    }
    function ShowComment(){//显示评论
        window.localStorage.setItem("dm5_HiddenComment","0");
        window.location.reload();
    }
    if(!!window.localStorage.getItem("dm5_HiddenComment")&&window.localStorage.getItem("dm5_HiddenComment")=="1"){//隐藏状态
        $("div.view-comment").remove();
        var $btnShowComment=$('<a href="javascript:void(0);" class="block">显示评论</a>');
        $("a.block").parent("div.container").append($btnShowComment);
        $btnShowComment.click(ShowComment);
    }
    else{
        var $btnHiddenComment=$('<a href="javascript:void(0);" class="block">隐藏评论</a>');
        $("a.block").parent("div.container").append($btnHiddenComment);
        $btnHiddenComment.click(HiddenComment);
    }
    $(document).keydown(function (evt) {
        evt = evt ? evt : (window.event ? window.event : null);
        if (evt.keyCode == 39){
            if($("#last-win").is(':visible')){
                console.log("下一章");
                window.location.href=$("a.view-btn-next").attr("href");//下一章
            }
            else{
                console.log("下一页");
                ShowNext();//下一页
            }
        }
        if (evt.keyCode == 37){
            console.log("上一页");
            ShowPre();//上一页
        }
        if (evt.keyCode == 86){  //v键是回到顶部
            window.scrollTo(0,0);
        }
    });
})();