Return to Snippet

Revision: 20657
at November 20, 2009 14:52 by Jamie


Initial Code
var maxWidth = 320;
var adjustmentSet = document.getElementById('col-main').getElementsByTagName('img');
for (var i=0; i < adjustmentSet.length; i++) {
	if(adjustmentSet[i].width > maxWidth){
		adjustmentSet[i].removeAttribute('height');
		adjustmentSet[i].style.width = '100%';
	}
}

Initial URL

                                

Initial Description

                                

Initial Title
Scale Images Down to Fit a Column

Initial Tags
images

Initial Language
JavaScript