Skip to content

Commit

Permalink
fixed up the dom-or-load single call
Browse files Browse the repository at this point in the history
  • Loading branch information
scottjehl committed Mar 22, 2012
1 parent 980b16c commit dfbc8f7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions picturefill.js
Expand Up @@ -51,12 +51,12 @@
// Run on resize and domready (w.load as a fallback)
if( w.addEventListener ){
w.addEventListener( "resize", w.picturefill, false );
if( w.document.onDOMContentLoaded ){
w.document.addEventListener( "DOMContentLoaded", w.picturefill, false );
}
else{
w.addEventListener( "load", w.picturefill, false );
}
w.addEventListener( "DOMContentLoaded", function(){
w.picturefill();
// Run once only
w.removeEventListener( "load", w.picturefill, false );
}, false );
w.addEventListener( "load", w.picturefill, false );
}
else if( w.attachEvent ){
w.attachEvent( "onload", w.picturefill );
Expand Down

0 comments on commit dfbc8f7

Please sign in to comment.