diff --git a/tieba page.js b/tieba page.js index 817153f..adfc7c1 100644 --- a/tieba page.js +++ b/tieba page.js @@ -37,7 +37,7 @@ let ssr = decodeURIComponent(url); let x = ssr.split('/'); let id = x[x.length - 1]; - value.outerHTML = `
gif
`; + value.outerHTML = `
gif
`; }) } } @@ -410,8 +410,14 @@ let x = img.src.split('/'); let u = x[x.length - 1]; let i = document.querySelector(`img[data-url="${u}"]`); - if (i && i.src !== img.src) { + + if (i && i.src !== img.src && i.dataset.type === 'gif') { i.src = img.src; + } else if (i && i.src !== img.src && !i.dataset.type) { + i.src = img.src; + i.addEventListener('click', evt => { + i.src = i.parentNode.dataset.url; + }); } } }