Skip to content

Instantly share code, notes, and snippets.

@cyamax
Created June 25, 2018 13:14
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Backlogのwikiの画像はでかすぎるから良い感じにする
// 指定した画像のサイズ以上はすべて指定サイズにする
var maxWidth = 600;
var elements = document.getElementsByTagName("img");
for(i=0;i<elements.length;i++){
if(elements[i].width > maxWidth){
elements[i].width = maxWidth;
console.log("小さくしたよ");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment