Jump to content

User:Maddy from Celeste/disinfobox.js

From Wikipedia, the free encyclopedia

This is the current revision of this page, as edited by Maddy from Celeste (talk | contribs) at 12:44, 3 April 2023 (make thumbnails). The present address (URL) is a permanent link to this version.

(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
for (let ibx of document.getElementsByClassName('infobox')) {
	for (let img of ibx.querySelectorAll('.infobox-image')) {
        let thumb = document.createElement('div');
        thumb.classList.add('thumb');
        thumb.classList.add('tright');
        let thumbinner = document.createElement('div');
        thumbinner.classList.add('thumbinner');
        thumb.appendChild(thumbinner);
        thumbinner.innerHTML = img.innerHTML;
        ibx.parentNode.insertBefore(thumb, ibx);
	}
	ibx.parentNode.removeChild(ibx);
}