Skip to content

Instantly share code, notes, and snippets.

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
You can’t perform that action at this time.