該網頁似乎使用的jQueryTOOLS Scrollable自定義或越野車實施。
糟糕的UI體驗是通過這個代碼在主網頁觸發:
<script>
// initialize scrollable para ademas
jQuery(document).ready(function() {
$("div.scroller_ademas").scrollable({
size: 1,
items: '#ademasaldea',
vertical: true
}).mousewheel({
items: '#ademasaldea'
});
});
</script>
而且所有的unbind()
電話和keyboard = false
集,應該工作,不影響鍵盤劫持!
幸運的是,冒犯的<script>
是相當原子的,所以Greasemonkey可以阻止那個有問題的JS而不會影響其他任何東西。
通過使用the stunningly-brilliant checkForBadJavascripts
utility來阻止JS。
像這樣:
// ==UserScript==
// @name _Block scrollable that's run amuck.
// @namespace _pc
// @include http://www.nacion.com/*
// @run-at document-start
// @require https://gist.github.com/raw/2620135/checkForBadJavascripts.js
// ==/UserScript==
checkForBadJavascripts ([
[false, /items\:\s+'\#ademasaldea'/, null]
]);
注意,這也將受益於被滾動停止「Ademas恩世界報」框中,但您可以修復通過添加
window.addEventListener ("load", function() {
GM_addStyle ('#ademasaldea { height: 100%; overflow-y: scroll; }');
}, false);
到腳本。
哇,非常感謝。我很高興我不是太遠:P永遠不會自己找到checkForBadJavascripts。 – willvv
實際上,我在測試之前感謝了它,這很奇怪,但它不會阻止腳本。行爲得到維護。 – willvv
我自己測試了這個腳本,它可以工作。你正在使用Firefox和Greasemonkey,對吧?每個版本有哪些版本?您是否有或需要登錄才能看到問題? –