Skip to content

Commit

Permalink
examples: xkcd.com: Show title text of the comic below it
Browse files Browse the repository at this point in the history
Similar to the script added recently for oglaf.com, but potentially the
more popular site and its a bit strange that I refer to this script but
don't have it in the public collection.
  • Loading branch information
DonKult committed Oct 9, 2018
1 parent 9a91568 commit c17704d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/xkcd.com/show-strip-texts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.dotpagemod-delete
{
font-variant: normal;
}
8 changes: 8 additions & 0 deletions examples/xkcd.com/show-strip-texts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
forIt('#comic > img', img => {
if (img.hasAttribute('title')) {
let title = document.createElement('div');
title.classList.add('dotpagemod-delete');
title.textContent = 'Title: ' + img.getAttribute('title');
img.parentNode.appendChild(title);
}
});

0 comments on commit c17704d

Please sign in to comment.