MediaWiki:Common.js
外观
注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的更改的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5。
//* 添加悬停计时器到行 */
(function() {
var selectors = 'tr, p';
document.querySelectorAll(selectors).forEach(function(element) {
var hoverTimer;
element.addEventListener('mouseenter', function() {
hoverTimer = setTimeout(function() {
element.classList.add('line');
}, 100);
});
element.addEventListener('mouseleave', function() {
clearTimeout(hoverTimer);
element.classList.remove('line');
});
});
})();