Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Re-initiate on ajax-load #44

Jpunt opened this Issue Oct 4, 2012 · 8 comments


None yet
7 participants

Jpunt commented Oct 4, 2012

I'm loading content dynamically using a XHR-request, containing some picture-elements. How can I re-initiate picturefill to handle these?

Just call picturefill() after your new content has been added to the DOM.

Jpunt commented Oct 12, 2012

So simple that I can't see why I didn't try that before. Thanks!

luksak commented Nov 16, 2012

I am using such a method in Drupal using the Drupal Javascript API. I am using a infinite scroll on a overview page with about 100 images. I am facing serious performance issues on older browsers. Should we maybe add a "processed" class to the wrapper div so that it gets processed only once?


attiks commented Nov 23, 2012

If you add a processed class to the div, you have to remove it on resize/orientationchange, otherwise the picturefill isn't executed on existing images.

drublic commented Feb 25, 2013

Thanks @seansean for the answer. It helped me solving my problem :)

@Jpunt This can be closed I think.
@luksak Maybe you want to open another issue and suggest this idea again.

luksak commented Feb 25, 2013

The serious performance issues i was facing were caused by the combination of picturefill and respond.js. @attiks was so kind to create a media query cache for picturefill for the Drupal module. This was a huge performance improvement. AND it works in IE :)


scottjehl commented Feb 28, 2014

Thanks for your ideas here. We're closing this out as Picturefill moves to support the new standard markup landing in browsers. Thread here: #125

Also, Angular info is linked in the readme.

@scottjehl scottjehl closed this Feb 28, 2014

Can we re-open this? I too am dynamically loading in images and have found that on IE10 if there is more than 40 images the browser crashes!! Actually I'll create a bug for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment