From bdd695988f5003563a5ce8a524f3646d799e776a Mon Sep 17 00:00:00 2001 From: xing Date: Tue, 31 Mar 2020 20:41:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tieba page.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tieba page.js b/tieba page.js index 150bd21..e244ee2 100644 --- a/tieba page.js +++ b/tieba page.js @@ -1,7 +1,7 @@ // ==UserScript== // @name tieba page // @namespace https://github.com/fthvgb1/tampermonkey-script -// @version 0.983 +// @version 0.984 // @author fthvgb1 // @match https://tieba.baidu.com/* // @match https://tiebac.baidu.com/* @@ -197,6 +197,11 @@ i.step = '1'; i.min = '1'; }); + i.addEventListener('keyup', ev => { + if (ev.key === 'Enter') { + i.blur(); + } + }); i.addEventListener('blur', ev => { let page = parseInt(i.value); if (page > 0 && page <= tot) { @@ -281,6 +286,7 @@ let url = `/mo/q//flr?fpn=${page}&kz=${kz}&pid=${tid}&is_ajax=1&has_url_param=0&template=lzl`; $.get(url, res => { replayPage(res, el); + el.scrollIntoView({block: "end", inline: "nearest", behavior: "smooth"}); }) }); }