Infinity Scroll

automatically creates element if user is near of the page bottom.

ของเมื่อวันที่ 02-03-2022 ดู เวอร์ชันล่าสุด

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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 Infinity Scroll
// @namespace -
// @version 0.1
// @description automatically creates element if user is near of the page bottom.
// @author NotYou
// @include *
// @require https://code.jquery.com/jquery-3.3.1.min.js
// @run-at document-idle
// @license GPL-3.0-or-later
// @grant none
// ==/UserScript==

// NOTE //
// Doesn't work if you can't scroll page //

(function() {
let css = '.infinityScroll{padding: 0% 0% 100%;}';
if (typeof GM_addStyle !== "undefined") {
  GM_addStyle(css);
} else {
  let styleNode = document.createElement("style");
  styleNode.appendChild(document.createTextNode(css));
  (document.querySelector("head") || document.documentElement).appendChild(styleNode);
}
})();


window.onscroll = function(ev) {
    if((window.innerHeight + window.scrollY) >= document.body.offsetHeight - 100) {
        $('body').append('<div class=infinityScroll></div>')
    }
};