Permalink
Browse files

following up with the same fix for the div branch, addressing #11

  • Loading branch information...
1 parent a548592 commit 4af59f13fec4d70a4a059e5ef26f074f9424ed80 scottjehl committed Apr 23, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 picturefill.js
View
@@ -31,9 +31,9 @@
}
}
+ var picImg = ps[ i ].getElementsByTagName( "img" )[ 0 ];
+
if( matches.length ){
- // Set fallback img element src from that of last matching source element
- var picImg = ps[ i ].getElementsByTagName( "img" )[ 0 ];
if( !picImg ){
picImg = w.document.createElement( "img" );
@@ -43,6 +43,9 @@
picImg.src = matches.pop().getAttribute( "data-src" );
}
+ else if( picImg ){
+ ps[ i ].removeChild( picImg );
+ }
}
}
};

0 comments on commit 4af59f1

Please sign in to comment.