Select spacer images
Regular expression to select image tags with images whose names end in spacer.
<img src="[\w\/\-\_]*spacer.[jpeg|jpg|gif|png]+[^>]*/?>
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
<img src="[\w\/\-\_]*spacer.[jpeg|jpg|gif|png]+[^>]*/?>
ffunction resizeImgOO(el) { function imgRatio() { return (el.height / el.width); } function holderRatio() { return (el.offsetParent.offsetHeight / el.offsetParent.offsetWidth); } function fitToContainer() { if(imgRatio>holderRatio) { el.height = el.offsetParent.offsetHeight; } else { el.width = el.offsetParent.offsetWidth; } } this.imgRatio = imgRatio; this.holderRatio = holderRatio; this.resize = fitToContainer; } var img = new resizeImgOO(document.getElementById('yourImgId')); img.resize();