Greasy Fork

手机看图、小说适配

页面旋转,自动滚动,图片集合

目前为 2023-10-13 提交的版本。查看 最新版本

// ==UserScript==
// @name         手机看图、小说适配
// @namespace    http://tampermonkey.net/
// @version      9.500.4.85
// @description  页面旋转,自动滚动,图片集合
// @author       You
// @match        *://*/*
// @grant        unsafeWindow
// @run-at       document-body
// @require      https://cdn.bootcss.com/jquery/3.6.0/jquery.min.js
// @license      MIT
// ==/UserScript==

$.noConflict();

jQuery.noConflict();

(function($) {

    'use strict';

    if (document.querySelector('.Jq-autoScroll-btn')) {
        return;
    }

    var replaceBlank = [
        "_cover(?=[.])",
        "[.](jpgs|th|md)(?=[.])",
        "(?<=[!])thumbnail_",
        "(?<=[/]uploads[/])thumb[/]",
        "(?<=[/])fill_w[0-9]{2,3}_h[0-9]{2,3}_g0_mark_",
        "(?<=[/])thumb_[0-9]{1,3}_[0-9]{2,3}_",
        "(?<=^).{0,200}[=](?=http)",
        "(?<=[=]http.{1,200}?)&.{0,200}(?=$)",
        "(?<=[?&])size=.{1,15}?(?=[&]|$)",
        "(?<=[?&])[wh]=[0-9]{2,3}(?=[&]|$)",
        "[^,0-9A-Za-z][0-9]{2,3}([,x]|%2C)[0-9]{2,3}(?=[^0-9A-Za-z]|$)",
    ];
    var reStrRepBlank = new RegExp(replaceBlank.join('|'), 'g');

    function clearBlank(urlB) {
        if (HDImg != 0) {
            urlB = urlB.replace(reStrRepBlank, "")
                .replace(/(?<=[=])(thumbnail)$/, "normal")
                .replace(/(?<=[!])(thumbnail|watermark)$/, "webp")
                .replace(/(?<=[0-9]{3})ps[.]jpg$/, "pl.jpg")
                .replace(/(?<=[/])[sm](?=_webp[/]|[/]ei[/])/, "b");
        }
        return urlB;
    }

    var HDImg = 0;

    var DSImg = 1;

    function dqSelect(selectPath) {
        return document.querySelectorAll(selectPath);
    }

    function addStyle(styleStr) {
        var style_node = document.createElement('style');
        style_node.type = 'text/css';
        style_node.innerHTML = styleStr;
        document.getElementsByTagName('head').item(0).appendChild(style_node);
    }

    addStyle(
        "html {" +
        "z-index: 2147483647 !important;}" +

        "body {" +
        "z-index: 2147483646 !important;" +
        "height: auto !important;" +
        "max-height: none !important;" +
        "scrollbar-width: none !important;" +
        "-ms-overflow-style: none !important;}" +

        "body::-webkit-scrollbar {" +
        "display: none !important;}" +

        "html,body {" +
        "overflow: visible !important;" +
        "scroll-behavior: auto !important;" +
        "position: relative !important;" +
        "overflow-wrap: break-word !important;}"
    );

    var winWidth = $(dqSelect("html")).width();

    if (winWidth == 0) {
        winWidth = $(document).width();
    }

    var winHeight = winWidth * window.innerHeight / window.innerWidth;

    var winW = winWidth > winHeight ? winHeight * 0.9 : winWidth;

    var width = winW * 0.1;

    var height = winW * 0.1;

    var top = (winHeight - height) * 0.5;

    var fontSz = winW * 0.036;

    addStyle(

        "html,body {" +
        "min-height: " + winHeight + "px !important;}" +

        "#Jq-autoScroll-ul {" +
        "display: block !important;" +
        "position: relative !important;" +
        "top: 0 !important;" +
        "left: 0 !important;" +
        "overflow: visible !important;" +
        "width: 100% !important;" +
        "height: auto !important;" +
        "z-index: 2147483646 !important;" +
        "margin: 0 !important;" +
        "border: 0 !important;" +
        "padding: 50px 0 700px 0 !important;" +
        "background-color: black !important;}" +

        "#Jq-autoScroll-ul *{" +
        "box-sizing: border-box !important;" +
        "padding: 0 !important;" +
        "margin: 0 !important;" +
        "position: static !important;" +
        "float: none !important;" +
        "border-radius: 0 !important;" +
        "height: auto !important;" +
        "opacity: 1 !important;" +
        "visibility: visible !important;" +
        "background-color: black !important;" +
        "background-image: none !important;}" +

        "#Jq-autoScroll-ul *::before,#Jq-autoScroll-ul *::after{" +
        "display: none !important;}" +

        "#Jq-autoScroll-ul img{" +
        "display: block;" +
        "object-fit: contain !important;" +
        "min-height:" + (winW * 0.13) + "px !important;" +
        "width: 100% !important;" +
        "border-bottom: 1px solid gray !important;}" +

        "#Jq-autoScroll-ul span,#Jq-autoScroll-ul a{" +
        "font-size:" + (winW * 0.045) + "px !important;" +
        "color: white;" +
        "word-wrap: break-word !important;" +
        "line-height: normal !important;}" +

        "#Jq-autoScroll-ul a:visited{" +
        "color: #741274;}" +

        "#Jq-autoScroll-ul a{" +
        "display: inline-block !important;" +
        "min-height:" + (winW * 0.13) + "px !important;" +
        "width: auto !important;" +
        "min-width: 25% !important;" +
        "max-width: 100% !important;" +
        "border: 1px solid red;" +
        "vertical-align: top !important;" +
        "text-decoration: none !important;}" +

        "#Jq-autoScroll-ul a.JsUl-HasImg{" +
        "min-width: 95% !important;}" +

        ".Jq-autoScroll-btn{" +
        "opacity: 0.6;" +
        "border-radius: 0px !important;" +
        "cursor: pointer !important;" +
        "z-index: 2147483647 !important;" +
        "padding: 0 !important;" +
        "border: 0 !important;" +
        "font-weight: bold !important;" +
        "font-size: " + fontSz + "px !important;" +
        "line-height:12px !important;" +
        "height:" + height + "px !important;" +
        "background-color:black !important;" +
        "color:white;" +
        "position:fixed !important;" +
        "width:" + width + "px !important;" +
        "left: 0%;" +
        "top: 0%;}" +

        ".JsWord-TextBig{" +
        "overflow-y: visible !important;" +
        "height: auto !important;" +
        "max-height: none !important;" +
        "background-color: black !important;" +
        "color: white !important;" +
        "line-height: normal !important;" +
        "word-break: break-word !important;" +
        "overflow-wrap: break-word !important;}"
    );

    var bodyHeight = $(dqSelect("body")).height();

    var jianG = height;

    var left2 = 0;

    var left = width + left2;

    var left3 = width * 2 + left2;

    var sameCss = "margin-left:" + left + "px;";
    var sameCss2 = "margin-left:" + left2 + "px;";
    var sameCss3 = "margin-left:" + left3 + "px;";

    var scrollNum = parseInt(winW * 0.15 / 10) * 10;

    var scrollJu = scrollNum * 2;

    var secZ = 1;

    function addInput(id, value, style) {
        var input_node = document.createElement('input');
        input_node.type = "button";
        input_node.setAttribute("class", "Jq-autoScroll-btn");
        input_node.setAttribute("id", id);
        input_node.setAttribute("value", value);
        input_node.setAttribute("style", style);
        $(dqSelect("html")).append(input_node);
    }

    addInput('Jq-autoScroll-rotate', 'R', sameCss + "px;margin-top:" + (top) + "px");
    addInput('Jq-autoScroll-jian', '-', sameCss + "px;margin-top:" + (top - jianG) + "px");
    addInput('Jq-autoScroll-jia', '+', sameCss + "px;margin-top:" + (top - 2 * jianG) + "px");
    addInput('Jq-autoScroll-Ju', (scrollJu / scrollNum * 50), sameCss + "px;margin-top:" + (top - 3 * jianG) + "px");
    addInput('Jq-autoScroll-sec', secZ, sameCss + "px;margin-top:" + (top - 4 * jianG) + "px");
    addInput('Jq-autoScroll-picwh', '100', sameCss + "px;margin-top:" + (top - 5 * jianG) + "px");

    addInput('Jq-autoScroll-del', 'X', sameCss2 + "px;margin-top:" + (top) + "px");
    addInput('Jq-autoScroll-width', 'W', sameCss2 + "px;margin-top:" + (top - jianG) + "px");
    addInput('Jq-autoScroll-pic', 'P', sameCss2 + "px;margin-top:" + (top - 2 * jianG) + "px");
    addInput('Jq-autoScroll-xy', '▽', sameCss2 + "px;margin-top:" + (top - 3 * jianG) + "px");
    addInput('Jq-autoScroll-up', '△', sameCss2 + "px;margin-top:" + (top - 4 * jianG) + "px");
    addInput('Jq-autoScroll-next', "N", sameCss2 + "px;margin-top:" + (top - 5 * jianG) + "px");

    addInput('Jq-autoScroll-transform', "T", sameCss3 + "px;margin-top:" + (top) + "px");
    addInput('Jq-autoScroll-HD', "H", sameCss3 + "px;margin-top:" + (top - jianG) + "px");
    addInput('Jq-autoScroll-DS', "S", sameCss3 + "px;margin-top:" + (top - 2 * jianG) + "px");

    $(dqSelect("html")).on('click', '#Jq-autoScroll-next', function() {
        var _len = $(dqSelect(".JsUl-PageNext")).length;
        $(dqSelect(".JsUl-PageNext")).each(function(index, dom) {
            if (xMove == 1) {
                if ($(this).offset().left > $(window).scrollLeft() + winWidth) {
                    autoScrollBy($(this).offset().left - $(window).scrollLeft() - 50);
                    $(dqSelect("#Jq-autoScroll-next")).val(index + 2);
                    return false;
                }

            } else {
                if ($(this).offset().top > $(window).scrollTop() + winHeight) {
                    autoScrollBy($(this).offset().top - $(window).scrollTop() - 50);
                    $(dqSelect("#Jq-autoScroll-next")).val(index + 2);
                    return false;
                }
            }
            if (index == _len - 1) {
                autoScrollTo($(dqSelect("#Jq-autoScroll-ul")).height());
            }
        });
        if (_len == 0) {
            autoScrollTo($(dqSelect("#Jq-autoScroll-ul")).height());
        }
    });

    var Dtransform = 0;

    $(dqSelect("html")).on('click', '#Jq-autoScroll-transform', function() {

        Dtransform += 1;

        if (Dtransform % 2 != 0) {
            setTimeout(function() {
                addStyle(
                    "body {" +
                    "transform: translate(0%, 0%) !important;}"
                );
            }, 100);

            $(dqSelect("#Jq-autoScroll-transform")).css("color", "green");

        } else {
            addStyle(
                "body {" +
                "transform: none !important;}"
            );
            $(dqSelect("#Jq-autoScroll-transform")).css("color", "white");
        }
    });

    $(dqSelect("html")).on('click', '#Jq-autoScroll-HD', function() {

        HDImg += 1;
        if (HDImg == 2) {
            HDImg = 0;
            $(dqSelect("#Jq-autoScroll-HD")).css("color", "white");
        } else {
            $(dqSelect("#Jq-autoScroll-HD")).css("color", "green");
        }
        if (picZ != 0) {
            picZ -= 1;
            $(dqSelect("#Jq-autoScroll-pic")).trigger("click");
        }
    });

    $(dqSelect("#Jq-autoScroll-DS")).css("color", "green");

    $(dqSelect("html")).on('click', '#Jq-autoScroll-DS', function() {

        DSImg += 1;
        if (DSImg == 2) {
            DSImg = 0;
            $(dqSelect("#Jq-autoScroll-DS")).css("color", "white");
        } else {
            $(dqSelect("#Jq-autoScroll-DS")).css("color", "green");
        }
        if (picZ != 0) {
            picZ -= 1;
            $(dqSelect("#Jq-autoScroll-pic")).trigger("click");
        }
    });

    var Drotate = 0;
    var xMove = 0;

    $(dqSelect("html")).on('click', '#Jq-autoScroll-rotate', function() {

        Drotate += 1;

        if (Drotate % 2 != 0) {

            var _scrollTop = getScrollTop();

            $(dqSelect("#Jq-autoScroll-rotate")).css("color", "green");

            var wrap_rotate;

            var wrap_rotate_inner;

            if ($(dqSelect('#wrap_rotate')).length == 0) {

                wrap_rotate = $('<div />', {
                    id: "wrap_rotate"
                });

                wrap_rotate_inner = $('<div />', {
                    id: "wrap_rotate_inner"
                });

                $(document.body).wrapInner(wrap_rotate_inner).wrapInner(wrap_rotate);

            }

            wrap_rotate = $(dqSelect('#wrap_rotate'));

            wrap_rotate_inner = $(dqSelect('#wrap_rotate_inner'));

            setTimeout(function() {

                wrap_rotate.attr('style', "display: block !important;" +
                    "z-index: 2147483646!important;" +
                    "position: relative !important;" +
                    "overflow: visible !important;" +
                    "height: " + (winHeight + 2) + "px !important;" +
                    "width: auto !important;");

                wrap_rotate_inner.attr('style', "display: block !important;" +
                    "z-index: 2147483647!important;" +
                    "position: relative !important;" +
                    "overflow: visible !important;" +
                    "left: -100% !important;" +

                    "transform: rotateZ(-90deg) !important;" +
                    "transform-origin: 100% 0 !important;" +
                    "-webkit-transform: rotateZ(-90deg) !important;" +
                    "-webkit-transform-origin: 100% 0 !important;" +
                    "-moz-transform: rotateZ(-90deg) !important;" +
                    "-moz-transform-origin: 100% 0 !important;" +

                    "float: right !important;" +
                    "width: " + winHeight + "px !important;");


                autoScrollTo(0);

                xMove = 1;

                autoScrollTo(_scrollTop * winHeight / winWidth);

            }, 100);

        } else {

            var _scrollLeft = getScrollLeft();

            $(dqSelect("#Jq-autoScroll-rotate")).css("color", "white");

            setTimeout(function() {
                $(dqSelect('#wrap_rotate')).attr('style', "z-index: 2147483646!important;" +
                    "position: relative !important;" +
                    "display: block !important;");
                $(dqSelect('#wrap_rotate_inner')).attr('style', "z-index: 2147483647!important;" +
                    "position: relative !important;" +
                    "display: block !important;");

                autoScrollTo(0);

                xMove = 0;

                autoScrollTo(_scrollLeft / winHeight * winWidth);

            }, 100);
        }

    });

    function getScrollLeft() {
        return $(window).scrollLeft() + $(dqSelect("body")).scrollLeft();

    }

    function getScrollTop() {
        return $(window).scrollTop() + $(dqSelect("body")).scrollTop();

    }

    function autoScrollBy(scrollBy_Ju) {
        if (xMove == 1) {
            $(dqSelect("html")).scrollLeft($(dqSelect("html")).scrollLeft() + scrollBy_Ju);
            $(dqSelect("body")).scrollLeft($(dqSelect("body")).scrollLeft() + scrollBy_Ju);

        } else {
            $(dqSelect("html")).scrollTop($(dqSelect("html")).scrollTop() + scrollBy_Ju);
            $(dqSelect("body")).scrollTop($(dqSelect("body")).scrollTop() + scrollBy_Ju);
        }
    }

    function autoScrollTo(scrollTo_Ju) {
        if (xMove == 1) {
            $(dqSelect("html,body")).scrollLeft(scrollTo_Ju);

        } else {
            $(dqSelect("html,body")).scrollTop(scrollTo_Ju);

        }
    }

    var widthN = 12;
    var fontZ;

    $(dqSelect("html")).on('click', '#Jq-autoScroll-width', function() {

        function interFn() {

            $(dqSelect(":not(.JsWord-TextBig)")).filter(function() {

                var _textLen = $(this).clone().children().remove().end().text().replace(/[^…,。?!:;~0-9一-龟A-Za-zA-Za-z]+/g, "").length;

                if (_textLen > 0) {
                    return true;
                } else {
                    return false;
                }
            }).addClass("JsWord-TextBig");

            $(dqSelect(".JsWord-TextBig")).css(wordCss);

            var textImg = $(dqSelect(".JsWord-TextBig")).has("em:not(.JsWord-TextBig),img");

            if (textImg.length > 0) {

                if (oldFSize == 0) {
                    oldFSize = textImg.first().find("em,img").first().width();
                }

                var _scale = fSize != "inherit" && oldFSize != 0 ? parseInt(fSize / oldFSize * 100 * 1.1) / 100 : 1;

                textImg.find("em:not(.JsWord-TextBig),img").css({
                    "transform": "scale(" + _scale + ")",
                    "-webkit-transform": "scale(" + _scale + ")",
                    "-moz-transform": "scale(" + _scale + ")",

                    "margin": "0 " + (_scale * 9 - 9) + "px",

                    "filter": "drop-shadow(0px -1px white)",
                    "-webkit-filter": "drop-shadow(0px -1px white)",
                    "-moz-filter": "drop-shadow(0px -1px white)",

                });
            }

            if (fSize == "inherit") {
                $(dqSelect(".JsWord-TextBig")).removeClass("JsWord-TextBig");
            }
        }

        var fSize = widthN > 15 ? "inherit" : parseInt(winWidth / widthN);

        var oldFSize = 0;

        var wordCss = {
            "font-size": fSize
        };

        clearInterval(fontZ);
        interFn();

        if (fSize != "inherit") {
            fontZ = setInterval(interFn, 4 * 1000);
            $(dqSelect("#Jq-autoScroll-width")).val(20 - widthN).css("color", "green");

        } else {
            $(dqSelect("#Jq-autoScroll-width")).val("W").css("color", "white");
            widthN = 10;
        }

        widthN += 2;

    });

    $(dqSelect("html")).on('click', ".JsWord-TextBig", function() {

        if ($(this).parents(".JsWord-TextBig").length == 0) {

            var fontH = parseInt($(this).css("font-size")) * 1.4;

            autoScrollBy((xMove == 1 ? winWidth : winHeight) - fontH);

        }
    });

    var picwh = 100;

    $(dqSelect("html")).on('click', "#Jq-autoScroll-picwh", function() {

        picwh += 200;

        if (picwh > 1000) {
            picwh = 100;
        }

        $(dqSelect("#Jq-autoScroll-picwh")).val(picwh);

        $(dqSelect("#Jq-autoScroll-ul img.JsUl-Imgloaded")).filter(function() {
            return this.naturalWidth < picwh || this.naturalHeight < picwh;
        }).hide();
    });

    var timeout_8;

    $(dqSelect("html")).on('touchstart', '#Jq-autoScroll-picwh', function() {
        timeout_8 = setTimeout(function() {

            picwh = 100;

            $(dqSelect("#Jq-autoScroll-picwh")).val(picwh);

            $(dqSelect("#Jq-autoScroll-ul img.JsUl-Imgloaded")).filter(function() {
                return this.naturalWidth >= picwh && this.naturalHeight >= picwh;
            }).show();

        }, 500);
    }).on('touchend touchmove', '#Jq-autoScroll-picwh', function() {
        clearTimeout(timeout_8);
    });

    $(dqSelect("html")).on('click', "#Jq-autoScroll-ul a", function() {
        if (Dscroll % 2 != 0) {
            $(dqSelect("#Jq-autoScroll-Ju")).trigger("click");
        }
    });

    var timeout_1;

    $(dqSelect("html")).on('touchstart', '#Jq-autoScroll-pic', function() {
        timeout_1 = setTimeout(function() {

            picZ -= 1;

            getImgArr();

        }, 500);
    }).on('touchend touchmove', '#Jq-autoScroll-pic', function() {
        clearTimeout(timeout_1);
    });

    var widthZ;
    var picZ = 0;
    var urlhost = location.protocol + location.host;

    $(dqSelect("html")).on('click', "#Jq-autoScroll-pic", function() {
        getImgArr();
    });

    function getImgArr() {

        function interFn() {
            var newImgAr = [];
            var _text = $(document.body).clone().children("script").remove().end().text()
                .match(/http.{1,150}?[.](xbm|tif|pjp|svgz|jpg|jpeg|ico|tiff|gif|svg|jfif|webp|png|bmp|pjpeg|avif)/g);

            $(dqSelect("div,li,a,:not(picture)>img,picture,[poster]")).not(".JsPic-ImgSelected").each(function(inum, dom) {

                var dataObj = [];

                var _img = $(this);

                _img.addClass("JsPic-ImgSelected");

                if (_img.closest("#Jq-autoScroll-ul").length == 0) {

                    if (_img.is(".pagetual_pageBar")) {

                        newImgAr.push("<div style='height: 0 !important; border: 0 !important; padding: 0 !important; overflow: hidden !important;' class='JsUl-PageNext' id='" + (_img.attr("id") ? _img.attr("id") : "") + "'>page-next</div>");
                    }

                    if (picZ == 2 && inum == 0 && _text != null) {
                        dataObj = dataObj.concat(_text);
                    }

                    var _backImg = _img.css("background-image").split(/&quot;|["']/);

                    dataObj.push(
                        _img.attr("src") ? _img.attr("src") :
                        _img.attr("poster") ? _img.attr("poster") : "",
                        _backImg.length > 1 ? _backImg[1] : ""
                    );

                    if (DSImg != 0) {

                        if (_img.is("img")) {
                            $.each(_img[0].attributes, function(index, item) {
                                if (/^srcset$/.test(item.name)) {
                                    dataObj.push(item.value.trim().split(" ")[0]);
                                } else if (!/^(src|style)$|^data[-]/.test(item.name)) {
                                    dataObj.push(item.value);
                                }
                            });
                        }

                        Object.values(_img.data()).forEach(function(i) {
                            if (typeof i == "object") {

                                var iSplit;
                                try {
                                    iSplit = JSON.stringify(i);
                                } catch {
                                    iSplit = null;
                                }

                                if (iSplit != null) {

                                    iSplit = iSplit.split(/&quot;|["']/);

                                    dataObj = dataObj.concat(iSplit.filter(function(j) {
                                        return j.length > 9 && /^http/.test(j);
                                    }));

                                }

                            } else {
                                dataObj.push(i);
                            }
                        });

                    }

                    if (_img.is("picture") && HDImg != 0) {
                        _img.children().each(function() {
                            $.each($(this)[0].attributes, function(index, item) {
                                if (!/^(style)$/.test(item.name)) {
                                    dataObj.push(item.value);
                                }
                            });
                        });
                    }

                    dataObj = Array.from(new Set(dataObj));

                    dataObj = dataObj.filter(function(i) {
                        return i.length > 1;
                    });

                    var _imgsStr = "";

                    var _imgStr = "";

                    dataObj.forEach(function(i) {

                        if (/^[A-Za-z/]/.test(i) && /[?/]/.test(i)) {

                            try {
                                var adr = new URL(i, urlhost);
                                i = adr.href;
                            } catch {
                                i = null;
                            }
                        } else {
                            i = null;
                        }

                        if (i != null) {
                            var i_2 = i;
                            i = /^data[:]image/.test(i) ? i : clearBlank(i);

                            var errorStr = i_2 != i ? "data-src='" + i_2 + "' " : "";

                            _imgStr = "<img src='" + i + "' " + errorStr + "decoding='async' loading='lazy' alt='图片' height='" + parseInt(winHeight * 0.13) + "' width='" + parseInt(winWidth) + "' >";

                            if (preArr.indexOf(i) == -1) {
                                preArr.push(i);

                                if (picZ == 2) {

                                    newImgAr.push(_imgStr);

                                }

                                if (picZ == 1) {

                                    _imgsStr += _imgStr;

                                }
                            }
                        }

                    });

                    if (_img.is("picture") && HDImg == 0) {
                        _imgsStr = _img.prop("outerHTML");
                        if (picZ == 2) {
                            newImgAr.push(_imgsStr);
                        }
                    }

                    if (picZ == 1 && (_imgsStr != "" || _img.is("a"))) {

                        var _pStr = (_img.attr("alt") ? _img.attr("alt") :
                            _img.attr("title") ? _img.attr("title") :
                            _img.text().replace(/\s+/g, "").length > 0 ? _img.text() :
                            _img.attr("id") ? _img.attr("id") :
                            _img.attr("class") ? _img.attr("class") : "").replace("JsPic-ImgSelected", "").substring(0, 44);

                        if (_pStr != "") {
                            _pStr = "<span>" + _pStr + "</span>";
                        }

                        var _a = _img.closest("a");

                        if (_a.length > 0) {
                            newImgAr.push(_a.clone(true).removeAttr(":href :onclick style class").attr({
                                "href": _a.attr("href") ? _a.attr("href") : "javascript:void (0);",
                                "onclick": _a.attr("onclick") ? _a.attr("onclick") : ""
                            }).html(_imgsStr + _pStr).prop("outerHTML"));

                        } else {
                            newImgAr.push("<a target='_blank' style='border:1px solid gray;' >" + _imgsStr + _pStr + "</a>");

                        }
                    }
                }
            });

            newImgAr = Array.from(new Set(newImgAr));

            if (newImgAr.toString() != imgAr.toString()) {

                var newArrEx = newImgAr.filter(function(n) {
                    return imgAr.indexOf(n) == -1;
                });

                $(dqSelect("#Jq-autoScroll-ul")).append(newArrEx);

                $(dqSelect("#Jq-autoScroll-ul img")).on("error", function() {
                    $(this).hide();

                    if ($(this).attr("data-src") && $(this).attr("data-src") != $(this).attr("src")) {
                        $(this).attr("src", $(this).attr("data-src"))
                    }
                });

                $(dqSelect("#Jq-autoScroll-ul img")).on("load", function() {
                    var natuW = this.naturalWidth;
                    var natuH = this.naturalHeight;

                    if (natuW < picwh || natuH < picwh) {

                        $(this).hide();

                    } else {
                        $(this).show().addClass("JsUl-Imgloaded").closest("a").addClass("JsUl-HasImg");

                    }
                });

                imgAr = newImgAr;

            }
        }

        clearInterval(widthZ);

        $(dqSelect("#Jq-autoScroll-ul")).remove();

        picZ += 1;

        if (picZ < 3) {

            if ($(dqSelect('#wrap_rotate')).length != 0) {
                $(dqSelect("#wrap_rotate_inner")).prepend("<div id='Jq-autoScroll-ul'>");

            } else {
                $(dqSelect("body")).prepend("<div id='Jq-autoScroll-ul'>");

            }

            picwh = 100;

            var imgAr = [];
            var preArr = [];
            var _allH = 0;
            var _numH = 0;

            $(dqSelect(".JsPic-ImgSelected")).removeClass("JsPic-ImgSelected");

            $(dqSelect("#Jq-autoScroll-picwh")).val(picwh);

            $(dqSelect("#Jq-autoScroll-pic")).css("color", "green").val(picZ);

            interFn();

            widthZ = setInterval(interFn, 6000);

        } else {

            $(dqSelect("#Jq-autoScroll-pic")).css("color", "white").val("P");

            picZ = 0;

        }

    }

    $(dqSelect("html")).on('click', "img", function() {

        if ($(this).closest("a,.JsWord-TextBig").length == 0 && $(this).children().length == 0) {

            var howH = xMove == 1 ? 0.4 * winWidth : 0.4 * winHeight;

            autoScrollBy(howH);
        }

    });

    $(dqSelect("html")).on('click', '#Jq-autoScroll-sec', function() {

        secZ -= 0.4;

        if (secZ < 0.4) {
            secZ = 1.4;
        }
        $(dqSelect("#Jq-autoScroll-sec")).val(secZ.toFixed(1));

        if (Dscroll % 2 != 0) {
            Dscroll = 0;
            $(dqSelect("#Jq-autoScroll-Ju")).trigger("click");
        }

    });

    var Dxy = 0;
    var pageX;
    var pageY;
    var timeHu;

    $(dqSelect("html")).on('click', '#Jq-autoScroll-xy', function() {

        var toH = $(document).height();

        Dxy += 1;

        clearTimeout(timeHu);

        if (Dxy % 2 == 1) {

            pageX = getScrollLeft();

            pageY = getScrollTop();

            autoScrollTo(toH);

            $(dqSelect("#Jq-autoScroll-xy")).val("=");
            $(dqSelect("#Jq-autoScroll-up")).val("=");

            timeHu = setTimeout(function() {
                Dxy += 1;
                $(dqSelect("#Jq-autoScroll-up")).val("△");
                $(dqSelect("#Jq-autoScroll-xy")).val("▽");

            }, 15 * 1000);

        } else {
            autoScrollTo(xMove == 1 ? pageX : pageY);

            $(dqSelect("#Jq-autoScroll-up")).val("△");
            $(dqSelect("#Jq-autoScroll-xy")).val("▽");

        }
    });

    $(dqSelect("html")).on('click', '#Jq-autoScroll-up', function() {

        Dxy += 1;

        clearTimeout(timeHu);

        if (Dxy % 2 == 1) {

            pageX = getScrollLeft();

            pageY = getScrollTop();

            autoScrollTo(0);

            $(dqSelect("#Jq-autoScroll-xy")).val("=");
            $(dqSelect("#Jq-autoScroll-up")).val("=");

            timeHu = setTimeout(function() {
                Dxy += 1;
                $(dqSelect("#Jq-autoScroll-up")).val("△");
                $(dqSelect("#Jq-autoScroll-xy")).val("▽");

            }, 15 * 1000);

        } else {
            autoScrollTo(xMove == 1 ? pageX : pageY);

            $(dqSelect("#Jq-autoScroll-up")).val("△");
            $(dqSelect("#Jq-autoScroll-xy")).val("▽");

        }
    });

    function delHide() {
        $(dqSelect(".Jq-autoScroll-btn")).hide();
        $(dqSelect("#Jq-autoScroll-del")).show().css({
            "opacity": "0.3",
        });
        if (picZ != 0 && $(dqSelect(".JsUl-PageNext")).length > 0) {
            $(dqSelect("#Jq-autoScroll-next")).show().css({
                "opacity": "0.3",
            });

        }
    }

    setTimeout(function() {
        delHide();
    }, 100);

    var Dhide = 1;

    $(dqSelect("html")).on('click', '#Jq-autoScroll-del', function() {

        Dhide += 1;

        if (Dhide % 2 != 0) {
            delHide();
        } else {
            $(dqSelect(".Jq-autoScroll-btn")).show();
            $(dqSelect("#Jq-autoScroll-del,#Jq-autoScroll-next")).css({
                "opacity": "0.6",

            });
            if (Dscroll % 2 != 0) {
                $(dqSelect("#Jq-autoScroll-Ju")).trigger("click");
            }
        }
    });

    $(dqSelect("html")).on('dblclick', '#Jq-autoScroll-del', function() {
        setTimeout(function() {
            $(dqSelect(".Jq-autoScroll-btn")).hide();
            $(dqSelect("#Jq-autoScroll-del")).css({
                "opacity": "0.3"
            });
            if (Dhide % 2 == 0) {
                Dhide = 1;
            }
        }, 100);
    });

    var timeout_2;
    $(dqSelect("html")).on('touchstart', '#Jq-autoScroll-del', function() {
        timeout_2 = setTimeout(function() {

            $(dqSelect(".Jq-autoScroll-btn")).hide();
            $(dqSelect("#Jq-autoScroll-del")).css({
                "opacity": "0.3"
            });
            if (Dhide % 2 == 0) {
                Dhide = 1;
            }

        }, 600);
    }).on('touchend touchmove', '#Jq-autoScroll-del', function() {
        clearTimeout(timeout_2);
    });

    $(dqSelect("html")).on('dblclick', function() {
        $(dqSelect("#Jq-autoScroll-del")).show();
    });

    var timeout_3;
    $(dqSelect("html")).on('touchstart', function() {
        timeout_3 = setTimeout(function() {

            $(dqSelect("#Jq-autoScroll-del")).show();
        }, 500);
    }).on('touchend touchmove', function() {
        clearTimeout(timeout_3);
    });

    $(dqSelect("html")).on('click', '#Jq-autoScroll-jia', function() {

        scrollJu += scrollNum;
        $(dqSelect("#Jq-autoScroll-Ju")).val(scrollJu / scrollNum * 50);

    });

    $(dqSelect("html")).on('click', '#Jq-autoScroll-jian', function() {

        scrollJu -= scrollNum;

        $(dqSelect("#Jq-autoScroll-Ju")).val(scrollJu / scrollNum * 50);

    });

    var timeout_4;
    $(dqSelect("html")).on('touchstart', '#Jq-autoScroll-jian', function() {
        timeout_4 = setTimeout(function() {

            scrollJu -= scrollNum * 6;

            $(dqSelect("#Jq-autoScroll-Ju")).val(scrollJu / scrollNum * 50);

        }, 500);
    }).on('touchend touchmove', '#Jq-autoScroll-jian', function() {
        clearTimeout(timeout_4);
    });

    var timeout_5;
    $(dqSelect("html")).on('touchstart', '#Jq-autoScroll-jia', function() {
        timeout_5 = setTimeout(function() {

            scrollJu += scrollNum * 6;

            $(dqSelect("#Jq-autoScroll-Ju")).val(scrollJu / scrollNum * 50);

        }, 500);
    }).on('touchend touchmove', '#Jq-autoScroll-jia', function() {
        clearTimeout(timeout_5);
    });

    var Dscroll = 0;
    var timeDown;

    $(dqSelect("html")).on('click', '#Jq-autoScroll-Ju', function() {

        Dscroll += 1;

        if (Dscroll % 2 != 0) {
            $(dqSelect("#Jq-autoScroll-Ju")).css("color", "green");

            clearInterval(timeDown);
            timeDown = setInterval(function() {
                autoScrollBy(xMove == 1 ? scrollJu / winHeight * winWidth : scrollJu);

            }, secZ * 1000);

        } else {
            $(dqSelect("#Jq-autoScroll-Ju")).css("color", "white");

            clearInterval(timeDown);

        }
    });

    // Your code here...
})(jQuery);