Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 4af59f13fec4d70a4a059e5ef26f074f9424ed80 1 parent a548592
scottjehl authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 picturefill.js
View
7 picturefill.js
@@ -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 );
+ }
}
}
};
Please sign in to comment.
Something went wrong with that request. Please try again.