This commit is contained in:
parent
e71348c820
commit
63a8fd3354
|
|
@ -2955,12 +2955,44 @@ $(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
function removeFakeLinks() {
|
||||||
|
$('a.fake_link').remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始執行一次
|
||||||
|
removeFakeLinks();
|
||||||
|
|
||||||
|
// Shift+Tab 時也執行
|
||||||
$(document).on('keydown', function(e) {
|
$(document).on('keydown', function(e) {
|
||||||
if (e.key === 'Tab' && e.shiftKey) {
|
if (e.key === 'Tab' && e.shiftKey) {
|
||||||
$('a.fake_link').remove();
|
removeFakeLinks();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// MutationObserver 監聽 DOM 變化,fake_link 一出現就移除
|
||||||
|
var observer = new MutationObserver(function(mutations) {
|
||||||
|
mutations.forEach(function(mutation) {
|
||||||
|
mutation.addedNodes.forEach(function(node) {
|
||||||
|
// 直接是 fake_link
|
||||||
|
if ($(node).is('a.fake_link')) {
|
||||||
|
$(node).remove();
|
||||||
|
}
|
||||||
|
// 或其子元素內含 fake_link
|
||||||
|
if ($(node).find) {
|
||||||
|
$(node).find('a.fake_link').remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
observer.observe(document.body, {
|
||||||
|
childList: true,
|
||||||
|
subtree: true
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
//gallery層級問題
|
||||||
$(function() {
|
$(function() {
|
||||||
var target = document.getElementById('gallery-theater-stage');
|
var target = document.getElementById('gallery-theater-stage');
|
||||||
if (!target) return;
|
if (!target) return;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue