Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- setInterval(function () {
- document.querySelectorAll('div.img-title').forEach(function (title) {
- title.parentNode.removeChild(title);
- });
- document.querySelectorAll('img.img').forEach(function (img) {
- if (!img.alt) {
- return;
- }
- var title = document.createElement('div');
- title.innerHTML = img.alt;
- title.className = 'img-title';
- title.style = 'padding: 5px; background: black; color: white; font-weight: bold; opacity: 0.9; position: absolute; top: 0;';
- img.parentNode.insertBefore(title, img.nextSlibing);
- });
- }, 2000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement