Created
January 3, 2016 15:37
-
-
Save knowlet/88c44eb8582a9472f9d8 to your computer and use it in GitHub Desktop.
Automatic load comic pictures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var table = document.querySelector("table"); | |
var source = document.querySelector("td[align] img").src.slice(0, -7); | |
var pages = Number(location.pathname.slice(-11, -8)); | |
for (var i = 2; i <= pages; ++i) { | |
var row = table.insertRow(i+3); | |
row.align="center"; | |
var cell = row.insertCell(0); | |
var page = ("000"+i).substr(-3); | |
cell.innerHTML = '<img src="' + source + page + '.jpg" border="0" onload="if(this.width>screen.width) {this.resized=true; this.width=screen.width*0.96;}">'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment