Greasy Fork

手机看图、小说适配

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

目前为 2023-09-01 提交的版本。查看 最新版本

// ==UserScript==
// @name         手机看图、小说适配
// @namespace    http://tampermonkey.net/
// @version      9.467
// @description  页面旋转,自动滚动,图片集合
// @author       You
// @match        *://*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=pixabay.com
// @grant unsafeWindow
// @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js
// @license MIT
// ==/UserScript==

var dom = {};

dom.query = jQuery.noConflict(true);

dom.query(function() {

    'use strict';

    if (document.querySelector('.JqScroll')) {
        return
    }

    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 {" +
        "overflow-x: scroll !important;" +
        "scroll-behavior: auto !important;}" +

        "body {" +
        "overflow: visible !important;}" +

        "html,body {" +
        "overflow-wrap: break-word;" +
        "height: auto !important;}");


    var winWidth = window.innerWidth;

    var winHeight = window.innerHeight;

    var winW;

    if (winWidth > winHeight) {

        winW = winHeight * 0.9;

    } else {

        winW = winWidth;

    }

    addStyle(
        "#Jscroll-ul *{" +
        "padding: 0 !important;" +
        "margin: 0 !important;" +
        "position: static !important;" +
        "float: none !important;" +
        "border-radius: 0 !important;" +
        "height: auto !important;" +
        //"max-height:" + (winW * 6) + "px !important;" +
        "opacity: 1 !important;" +
        "visibility: visible !important;" +
        "background-color: black !important;" +
        "object-fit: contain !important;" +
        "background-image: none !important;}" +

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

        "#Jscroll-ul > img{" +
        "border-bottom: 1px solid gray !important;}" +

        "#Jscroll-ul img{" +
        "display: block;" +
        "min-height:" + (winW * 0.5) + "px !important;" +
        "width: 100% !important;}" +

        "#Jscroll-ul p{" +
        "display: block;}" +

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

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

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

        ".word-text-big{" +
        "background-color: black !important;" +
        "color: white !important;" +
        "line-height: normal !important;" +
        "overflow-wrap: break-word !important;" +
        "height: auto !important;}");

    var width = winW * 0.125;

    var height = winW * 0.1;

    var top = winHeight * 0.35 - winW * 0.05;

    var fontSz = winW * 0.036;

    var jianG = winW * 0.1;

    var left2 = -0.125 * winW * 0.125;

    var left = winW * 0.125 + left2;

    var twoCss = "position:absolute; top:0; left: 0; overflow: visible; width: 100%!important; height: auto!important; z-index: 2147483646!important; margin: 0; border: 0; background-color: black;"

    var aScss = "opacity: 0.7; border-radius: " + (width * 0.1) + "px;cursor: pointer; z-index: 2147483647!important; padding: 0!important; font-weight: bold; font-size: " + fontSz + "px !important;line-height:12px!important; border:2px solid white;height:" + height + "px;background-color:black;color:white;position:fixed;width:" + width + "px;left:0%; top: 15%; ";

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

    var scrollJu = 270;
    var secZ = 2;

    function addInput(id, value, style) {
        var input_node = document.createElement('input');
        input_node.type = "button";
        input_node.setAttribute("class", "JqScroll");
        input_node.setAttribute("id", id);
        input_node.setAttribute("value", value);
        input_node.setAttribute("style", style);
        document.body.appendChild(input_node);
    }

    addInput('Jscroll-rotate', 'R', sameCss + "px;margin-top:" + (top) + "px");
    addInput('Jscroll-jian', '-', sameCss + "px;margin-top:" + (top - jianG) + "px");
    addInput('Jscroll-jia', '+', sameCss + "px;margin-top:" + (top - 2 * jianG) + "px");
    addInput('Jscroll-Ju', scrollJu, sameCss + "px;margin-top:" + (top - 3 * jianG) + "px");
    addInput('Jscroll-sec', secZ, sameCss + "px;margin-top:" + (top - 4 * jianG) + "px");

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

    var Drotate = 0;
    var xMove = 0;

    dom.query("body").on('touchstart', '#Jscroll-rotate', function() {

        Drotate += 1;

        if (Drotate % 2 != 0) {

            dom.query("#Jscroll-rotate").css("color", "green");

            var wrap_rotate;

            var wrap_rotate_inner;

            if (dom.query('#wrap_rotate').length == 0) {

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

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

                dom.query('body').wrapInner(wrap_rotate_inner).wrapInner(wrap_rotate);
            }

            wrap_rotate = dom.query('#wrap_rotate');

            wrap_rotate_inner = dom.query('#wrap_rotate_inner');

            var window_width = winHeight;

            window.scrollTo(0, 3 * window_width);

            setTimeout(function() {

                wrap_rotate.append(dom.query(".JqScroll"));

                wrap_rotate.attr('style', "z-index: 2147483647!important; overflow: visible; height: " + (window_width) + "px; width: auto;");

                wrap_rotate_inner.attr('style', "z-index: 2147483647!important; position: relative; left: -100%; -webkit-transform: rotateZ(-90deg); -webkit-transform-origin-x: 100%; -webkit-transform-origin-y: 0%; -moz-transform: rotateZ(-90deg); -moz-transform-origin-x: 100%; -moz-transform-origin-y: 0%;float: right; width: " + window_width + "px;");

                xMove = 1;

                dom.query("#Jscroll-ul").css({
                    "padding": "0 0 1500px 0",
                });

                dom.query("#wrap_rotate").css({
                    "min-width": dom.query("#wrap_rotate_inner").outerHeight() + 1500,
                });

                window.scrollTo(0, 0);

            }, 200);
        } else {
            dom.query("#Jscroll-rotate").css("color", "white");

            xMove = 0;

            dom.query("#Jscroll-ul").css({
                "padding": "0 0 800px 0",
            });

            setTimeout(function() {
                dom.query('#wrap_rotate').attr('style', "");
                dom.query('#wrap_rotate_inner').attr('style', "");

            }, 200);
        }

    });

    var widthN = 12;
    var fontZ;

    dom.query("body").on('touchstart', '#Jscroll-width', function() {

        var fSize = parseInt(dom.query(document).width() / widthN);

        dom.query("#Jscroll-width").css("color", "green");

        if (widthN > 17) {

            fSize = "inherit";
            dom.query("#Jscroll-width").css("color", "white");

        }

        function interFn() {

            dom.query("em").each(function() {
                if (dom.query(this).css("background-image").indexOf("url") > -1) {

                    dom.query(this).css("font-size", dom.query(this).css("font-size"));

                    var _scale;

                    if (fSize != "inherit") {
                        _scale = parseInt(fSize / parseInt(dom.query(this).css("font-size")) * 10) / 10 / 2.2 * 1.8;
                    } else {
                        _scale = 1;
                    }

                    dom.query(this).css({
                        "transform": "scale(" + _scale + ")", //1.8
                        "margin": "0 " + (_scale * 9 - 9) + "px",
                    });

                }
            });

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

            dom.query("p,strong,span,h1,h2,h3").filter(function() {
                return !dom.query(this).is(":has(a)") || dom.query(this).clone().children().remove().end().text().length > 30;
            }).css(wordCss).not(".word-text-big").addClass("word-text-big");

            dom.query(":not(:has(div,li),p,strong,span,h1,h2,h3)").filter(function() {
                return dom.query(this).clone().children().remove().end().text().length > 100;
            }).css(wordCss).not(".word-text-big").addClass("word-text-big");

        }

        clearInterval(fontZ);
        interFn();
        fontZ = setInterval(interFn, 4 * 1000);

        dom.query("#Jscroll-width").val(20 - widthN);
        if (widthN == 18) {
            dom.query("#Jscroll-width").val("W");

        }
        if (fSize == "inherit") {
            widthN = 10;
        }

        widthN += 2;

    });

    dom.query("body").on('click', ".word-text-big", function(e) {

        if (dom.query(this).parents(".word-text-big").length == 0) {

            var touchX = e.clientX;
            var touchY = e.clientY;
            var fontH = parseInt(dom.query(this).css("font-size")) * 1.4;
            var scrollH = 0.5;

            if (xMove == 1) {
                window.scrollBy((winWidth - fontH) * (touchX > winWidth * scrollH ? 1 : -1), 0);

            } else {
                window.scrollBy(0, (winHeight - fontH) * (touchY > winHeight * scrollH ? 1 : -1));

            }
        }
    });

    var picwh = 100;

    dom.query("body").on('touchstart', "#Jscroll-picwh", function() {

        picwh += 100;

        dom.query("#Jscroll-picwh").val(picwh);

        dom.query("#Jscroll-ul img:visible").each(function() {

            if (this.naturalWidth) {

                if (this.naturalWidth < picwh || this.naturalHeight < picwh) {
                    dom.query(this).hide();

                }
            }
        });
    });

    var timeout_8;

    dom.query("body").on('touchstart', '#Jscroll-picwh', function() {
        timeout_8 = setTimeout(function() {

            picwh = 100;

            dom.query("#Jscroll-picwh").val(picwh);

            dom.query("#Jscroll-ul img").filter(function() {
                return this.naturalWidth;
            }).show();

            dom.query("#Jscroll-ul img:visible").each(function() {

                if (this.naturalWidth) {

                    if (this.naturalWidth < picwh || this.naturalHeight < picwh) {
                        dom.query(this).hide();

                    }
                }
            });

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

    function clearBlank(urlB) {
        return urlB.trim().split(/(?<=[.](xbm|tif|pjp|svgz|jpg|jpeg|ico|tiff|gif|svg|jfif|webp|png|bmp|pjpeg|avif))[?]/)[0];

    }

    dom.query("body").on('click', "#Jscroll-ul a", function() {
        if (Dscroll % 2 != 0) {
            Dscroll += 1;
            dom.query("#Jscroll-Ju").css("color", "white");

            clearInterval(timeDown);
        }
    });

    var widthZ;
    var downImg;
    var picZ = 0;

    dom.query("body").on('touchstart', "#Jscroll-pic", function() {

        function interFn() {
            var preArr = [];
            var dataObj = {};
            var newImgAr = [];

            dom.query("div,li,a,img,[srcset],[poster]").each(function() {

                var _img = dom.query(this);

                if (!_img.parent().is("#Jscroll-ul") && !_img.parent().parent().is("#Jscroll-ul")) {

                    var _backImg = _img.css("background-image").split("\"");

                    Object.assign(dataObj, {

                        "_src": _img.attr("src") ? _img.attr("src") : "",

                        "_srcset": _img.attr("srcset") ? _img.attr("srcset") : "",

                        "_text": _img.text().length > 10 && _img.text().length < 200 ? _img.text() : "",

                        "_poster": _img.attr("poster") ? _img.attr("poster") : "",

                        "_backImg": _backImg.length > 1 ? _backImg[1] : "",

                    });

                    Object.assign(dataObj, _img.data());

                    var _imgStr = "";

                    dom.query.each(dataObj, function(v, i) {

                        i = i.toString();

                        if (/[/?]/.test(i)) {

                            i = clearBlank(i);

                            _imgStr = "<img src='" + i + "'>";

                            if (picZ == 1 || picZ == 3) {

                                newImgAr.push(_imgStr);

                            }

                            if (picZ == 2 && preArr.indexOf(i) == -1) {

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

                                var _pStr;

                                if (_img.attr("alt")) {

                                    _pStr = "<p>" + _img.attr("alt") + "</p>";

                                } else {

                                    _pStr = _img.attr("title") ? "<p>" + _img.attr("title") + "</p>" : "";

                                }

                                if (_a.length != 0) {

                                    var _href = _a.attr("href") ? "href='" + _a.attr("href") + "'" : "";

                                    var _onclick = _a.attr("onclick") ? _a.attr("onclick") : "";

                                    newImgAr.push("<a " + _href + " onclick=" + _onclick + ">" + _imgStr + _pStr + "</a>");

                                    preArr.push(i);

                                } else {

                                    newImgAr.push(_imgStr, _pStr);

                                }

                            }
                        }
                    });

                    if (picZ == 2 && _img.is("a")) {

                        var _href = _img.attr("href") ? "href='" + _img.attr("href") + "'" : "";

                        var _onclick = _img.attr("onclick") ? _img.attr("onclick") : "";

                        var _text = _img.attr("title") ? _img.attr("title") : _img.text();

                        newImgAr.push("<a " + _href + " onclick=" + _onclick + ">" + _text + "</a>");

                    }
                }
            });

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

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

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

                dom.query("#Jscroll-ul").append(newArrEx);

                var isSupportLoading = 'loading' in document.createElement('img');
                if (isSupportLoading) {
                    dom.query("#Jscroll-ul img").attr("loading", "lazy");
                }

                dom.query("#Jscroll-ul>a:has(img)").css({
                    "width": "100%",
                    "display": "block",
                });

                dom.query("#Jscroll-ul img").on('error', function() {
                    dom.query(this).hide();
                });

                dom.query("#Jscroll-ul img").on("load", function() {
                    var natuW = this.naturalWidth;
                    var natuH = this.naturalHeight;

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

                        dom.query(this).hide();

                    } else {

                        if (_numH < 6) {

                            _allH += natuW < natuH ? natuW : natuH;
                            _numH += 1;

                        }

                        if (_numH == 5) {

                            picwh = parseInt(_allH * 0.6 / _numH / 100) * 100;

                            if (picwh < 100) {
                                picwh = 100;
                            }

                            dom.query("#Jscroll-picwh").val(picwh);

                            dom.query("#Jscroll-ul img:visible").each(function() {

                                if (this.naturalWidth) {

                                    if (this.naturalWidth < picwh || this.naturalHeight < picwh) {
                                        dom.query(this).hide();

                                    }
                                }
                            });

                        }
                    }
                });

                imgAr = newImgAr;
            }
        }

        clearInterval(widthZ);

        clearInterval(downImg);

        dom.query("#Jscroll-ul").remove();

        picZ += 1;

        if (picZ < 4) {
            if (xMove == 1) {
                dom.query("#wrap_rotate_inner").prepend("<div id='Jscroll-ul' style='" + twoCss + "'>");

                dom.query("#Jscroll-ul").css({
                    "padding": "0 0 1500px 0",
                });

            } else {
                dom.query("body").prepend("<div id='Jscroll-ul' style='" + twoCss + "'>");

                dom.query("#Jscroll-ul").css({
                    "padding": "0 0 800px 0",
                });
            }

            picwh = 100;

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

            dom.query("#Jscroll-picwh").val(picwh);

            dom.query("#Jscroll-pic").css("color", "green").val(picZ);

            interFn()

            widthZ = setInterval(interFn, 6000);

            if (picZ == 3 && xMove == 0) {

                downImg = setInterval(function() {

                    var ulTop = parseInt(dom.query("#Jscroll-ul").css("top"));

                    var newTop = parseInt(dom.query(document).height() - dom.query("#Jscroll-ul").outerHeight()) - 1;

                    if (ulTop < newTop) {

                        dom.query("#Jscroll-ul").css({
                            "top": newTop,
                        });

                        window.scrollBy(0, newTop - ulTop);
                    }

                }, 1000);
            }

        } else {

            dom.query("#Jscroll-pic").css("color", "white").val("P");

            picZ = 0;
        }

    });

    dom.query("body").on('click', "#Jscroll-ul>*:not(a)", function(e) {

        var touchX = e.clientX;
        var touchY = e.clientY;
        var howH = 0.5;
        var scrollH = 0.5;

        if (xMove == 1) {
            window.scrollBy(winWidth * howH * (touchX > winWidth * scrollH ? 1 : -1), 0);

        } else {
            window.scrollBy(0, winHeight * howH * (touchY > winHeight * scrollH ? 1 : -1));

        }
    });

    var timeout_7;

    dom.query("body").on('touchstart', '#Jscroll-pic', function() {
        timeout_7 = setTimeout(function() {

            clearInterval(widthZ);

            dom.query("#Jscroll-ul").remove();
            dom.query("#Jscroll-pic").css("color", "white").val("P");

            picZ = 0;
        }, 500);
    }).on('touchend touchmove', '#Jscroll-pic', function() {
        clearTimeout(timeout_7);
    });

    dom.query("body").on('touchstart', '#Jscroll-sec', function() {

        secZ -= 1;

        if (secZ < 0) {
            secZ = 3
        }
        if (secZ < 1) {
            secZ = 0.6
        }
        dom.query("#Jscroll-sec").val(secZ);

    });

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

    dom.query("body").on('touchstart', '#Jscroll-xy', function() {
        var toH;

        if (xMove != 1) {
            toH = dom.query(document).height();

        } else {
            toH = dom.query("#wrap_rotate_inner").outerHeight() - 250;

        }
        Dxy += 1;

        clearTimeout(timeHu);

        if (Dxy % 2 == 1) {

            pageX = dom.query(window).scrollLeft();
            pageY = dom.query(window).scrollTop();

            if (xMove == 1) {
                window.scrollTo(toH, 0);

            } else {
                window.scrollTo(0, toH);
            }
            dom.query("#Jscroll-xy").val("=");
            dom.query("#Jscroll-up").val("=");

            timeHu = setTimeout(function() {
                Dxy += 1;
                dom.query("#Jscroll-up").val("△");
                dom.query("#Jscroll-xy").val("▽");

            }, 8 * 1000);

        } else {

            window.scrollTo(pageX, pageY);
            dom.query("#Jscroll-up").val("△");
            dom.query("#Jscroll-xy").val("▽");

        }
    });

    dom.query("body").on('touchstart', '#Jscroll-up', function() {

        Dxy += 1;

        clearTimeout(timeHu);

        if (Dxy % 2 == 1) {

            pageX = dom.query(window).scrollLeft();
            pageY = dom.query(window).scrollTop();

            window.scrollTo(0, 0);

            dom.query("#Jscroll-xy").val("=");
            dom.query("#Jscroll-up").val("=");

            timeHu = setTimeout(function() {
                Dxy += 1;
                dom.query("#Jscroll-up").val("△");
                dom.query("#Jscroll-xy").val("▽");

            }, 8 * 1000);

        } else {

            window.scrollTo(pageX, pageY);
            dom.query("#Jscroll-up").val("△");
            dom.query("#Jscroll-xy").val("▽");

        }
    });

    setTimeout(function() {
        dom.query(".JqScroll").hide();
        dom.query("#Jscroll-del").show().css({
            "opacity": "0.4",
            "-webkit-transform": "scale(0.72)",
            "-moz-transform": "scale(0.72)",
            "transform": "scale(0.72)",

        });
    }, 100);

    var Dhide = 1;

    dom.query("body").on('touchstart', '#Jscroll-del', function() {

        Dhide += 1;

        if (Dhide % 2 != 0) {
            dom.query(".JqScroll").hide();
            dom.query("#Jscroll-del").show().css({
                "opacity": "0.4",
                "-webkit-transform": "scale(0.72)",
                "-moz-transform": "scale(0.72)",
                "transform": "scale(0.72)",
            });

        } else {
            dom.query(".JqScroll").show();
            dom.query("#Jscroll-del").css({
                "opacity": "0.8",
                "-webkit-transform": "scale(1)",
                "-moz-transform": "scale(1)",
                "transform": "scale(1)",

            });
            if (Dscroll % 2 != 0) {
                Dscroll += 1;
                dom.query("#Jscroll-Ju").css("color", "white");

                clearInterval(timeDown);
            }
        }
    });

    var timeout_2;
    dom.query("body").on('touchstart', '#Jscroll-del', function() {
        timeout_2 = setTimeout(function() {

            dom.query(".JqScroll").hide();
            dom.query("#Jscroll-del").css({
                "opacity": "0.4",
                "-webkit-transform": "scale(0.72)",
                "-moz-transform": "scale(0.72)",
                "transform": "scale(0.72)",

            });
            if (Dhide % 2 == 0) {
                Dhide += 1;
            }

        }, 700);
    }).on('touchend touchmove', '#Jscroll-del', function() {
        clearTimeout(timeout_2);
    });

    var timeout_3;
    dom.query("body").on('touchstart', function() {
        timeout_3 = setTimeout(function() {

            dom.query("#Jscroll-del").show();
        }, 500);
    }).on('touchend touchmove', function() {
        clearTimeout(timeout_3);
    });

    dom.query("body").on('touchstart', '#Jscroll-jia', function() {

        scrollJu += 45;
        dom.query("#Jscroll-Ju").val(scrollJu);

    });

    dom.query("body").on('touchstart', '#Jscroll-jian', function() {

        scrollJu -= 45;

        dom.query("#Jscroll-Ju").val(scrollJu);

    });

    var timeout_4;
    dom.query("body").on('touchstart', '#Jscroll-jian', function() {
        timeout_4 = setTimeout(function() {

            scrollJu -= 45 * 9;

            dom.query("#Jscroll-Ju").val(scrollJu);

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

    var timeout_5;
    dom.query("body").on('touchstart', '#Jscroll-jia', function() {
        timeout_5 = setTimeout(function() {

            scrollJu += 45 * 9;

            dom.query("#Jscroll-Ju").val(scrollJu);

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

    var Dscroll = 0;
    var timeDown;
    var timeout_6;
    dom.query("body").on('touchstart', '#Jscroll-Ju', function() {
        timeout_6 = setTimeout(function() {

            scrollJu = 270;

            dom.query("#Jscroll-Ju").val(scrollJu);

            Dscroll += 1;

            if (Dscroll % 2 != 0) {
                dom.query("#Jscroll-Ju").css("color", "green");

                clearInterval(timeDown);
                timeDown = setInterval(function() {
                    if (xMove == 1) {
                        window.scrollBy(scrollJu, 1)
                        window.scrollBy(0, -1);
                    } else {
                        window.scrollBy(0, scrollJu)
                    }

                }, secZ * 1000);

            } else {
                dom.query("#Jscroll-Ju").css("color", "white");

                clearInterval(timeDown);

            }
        }, 500);
    }).on('touchend touchmove', '#Jscroll-Ju', function() {
        clearTimeout(timeout_6);
    });

    dom.query("body").on('touchstart', '#Jscroll-Ju', function() {

        Dscroll += 1;

        if (Dscroll % 2 != 0) {
            dom.query("#Jscroll-Ju").css("color", "green");

            clearInterval(timeDown);
            timeDown = setInterval(function() {
                if (xMove == 1) {

                    window.scrollBy(scrollJu, 0);

                } else {

                    window.scrollBy(0, scrollJu);

                }

            }, secZ * 1000);

        } else {
            dom.query("#Jscroll-Ju").css("color", "white");

            clearInterval(timeDown);

        }

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