微信读书PC自动滚动!

微信读书PC自动滚动

目前为 2020-11-27 提交的版本。查看 最新版本

// ==UserScript==
// @name         微信读书PC自动滚动!
// @version      0.1
// @require      http://cdn.staticfile.org/jquery/1.8.3/jquery.min.js
// @match        *://weread.qq.com/web/reader/*
// @description    微信读书PC自动滚动

// @namespace https://gf.qytechs.cn/users/518563
// ==/UserScript==

// Your code here...

$(window).on('load', function () {
    var butDiy = "<button title='自动滚动' class='readerControls_item autoScroll' style='color:#bdbdbd;cursor:pointer;'>滚动X1</button><button title='停止滚动' class='readerControls_item autoScrollOff' style='color:#bdbdbd;cursor:pointer;'>停止</button>"
    $('.readerControls').append(butDiy);
    var num = 1
    $('.autoScroll').click(function () {
        num++;
        autoScroll()
        $('.autoScroll').html('播放X' + num)
    })
    // 滑动屏幕,滚至页面底部
    function autoScroll() {
        var distance = 1;
        var timer = setInterval(() => {
            var totalHeight = document.documentElement.scrollTop;
            var scrollHeight = document.body.scrollHeight;
            window.scrollBy(0, distance);
            totalHeight += distance;
            if (totalHeight >= scrollHeight) {
                clearInterval(timer);
            }
            $('.autoScrollOff').click(function () {
                num = 0
                clearInterval(timer);
            })
        }, 20);
    }
})




QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址