Skip to content

Instantly share code, notes, and snippets.

@Spoygg
Created November 10, 2014 13:26
Show Gist options
  • Save Spoygg/4320142e25efab3ecada to your computer and use it in GitHub Desktop.
Save Spoygg/4320142e25efab3ecada to your computer and use it in GitHub Desktop.
javascript: (function() { var imageMaxWidth = 800; var parseForImages = function(node) { if (node.tagName === 'IMG' && node.width > imageMaxWidth) { node.style.maxWidth = imageMaxWidth + 'px'; return; } if (node.children) { for (var i = 0; i < node.children.length; i++) { parseForImages(node.children[i]); } } }; var messages = document.getElementsByClassName('adn'); for (var i = 0; i < messages.length; i++) { parseForImages(messages[i]); } })();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment