From eb500a74f8516898b2b42abac19e7d69aa18514a Mon Sep 17 00:00:00 2001 From: xing Date: Mon, 2 Mar 2020 23:54:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tieba page.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tieba page.js b/tieba page.js index 9427b9b..1e9cd13 100644 --- a/tieba page.js +++ b/tieba page.js @@ -295,13 +295,21 @@ document.querySelector('.father-cut-pager-class-no-page').classList.remove('father-cut-pager-class-no-page'); - - $("#list_pager>a").on("click", function () { - setTimeout(t, 3000); + let list = document.querySelector('ul#pblist'); + let MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; + let observer = new MutationObserver((mutations) => { + if (mutations.length > 0) { + t(); + } }); - $('.j_pager_input').blur(() => { - setTimeout(t, 3000); - }) + + observer.observe(list, { + attributes: true, + childList: true, + characterData: true + }); + + } try {