Skip to content

Commit

Permalink
Fallback to fixed width values if aspect ratio is specified and width…
Browse files Browse the repository at this point in the history
… is not (or auto)
  • Loading branch information
Thad Cox committed Jun 12, 2012
1 parent 499216e commit a415a92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion foresight.js
Expand Up @@ -501,7 +501,7 @@
computedWidthValue = getComputedStyleValue( img, DIMENSION_WIDTH ); computedWidthValue = getComputedStyleValue( img, DIMENSION_WIDTH );
img.style[ STYLE_ATTRIBUTE_DISPLAY ] = oldDisplay; img.style[ STYLE_ATTRIBUTE_DISPLAY ] = oldDisplay;


if ( computedWidthValue === 'auto' || computedWidthValue.indexOf( '%' ) > 0 ) { if ( ( img[ ASPECT_RATIO] && computedWidthValue === 'auto' ) || computedWidthValue.indexOf( '%' ) > 0 ) {
// if the width has a percent value then change the display to // if the width has a percent value then change the display to
// display:block to help get correct browser pixel width // display:block to help get correct browser pixel width
img.unitType = UNIT_TYPE_PERCENT; img.unitType = UNIT_TYPE_PERCENT;
Expand Down

0 comments on commit a415a92

Please sign in to comment.