Skip to content
This repository has been archived by the owner on Jan 9, 2022. It is now read-only.

Commit

Permalink
Add temp fix for IE attribute issue
Browse files Browse the repository at this point in the history
A messy fix which removes the width and height attributes automatically added when img element is created in IE < 9
  • Loading branch information
davebeesleyarchived committed Nov 12, 2013
1 parent 548f8fa commit 51c3eb2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions picturefill.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@

picImg.src = matchedEl.getAttribute( "data-src" );
matchedEl.appendChild( picImg );
if(picImg.hasAttribute("width")){
picImg.removeAttribute("width");
}
if(picImg.hasAttribute("height")){
picImg.removeAttribute("height");
}
}
else if( picImg ){
picImg.parentNode.removeChild( picImg );
Expand Down

0 comments on commit 51c3eb2

Please sign in to comment.