You can clone with
HTTPS or Subversion.
Triggering a custom event at the end of the pictureFill function would have some benefits I think.
Imagine if you have a responsive slideshow with images of different height. Right now, If you add the slideshow on document ready it will have a wrong height since the images are not replaced yet. You could use some imagesLoaded plugin, but again, the images are not replaced when you call it and it will still give a wrong height.
One workaround is to create the slideshow on document load event but it's not the best solution and can have some "long" delay.
Since on my setup I have jQuery I simply added this at the end of the pictureFill function:
Then I was able to simply do something like this and it fixed my issue:
So, is this kind of addition possible? If it is, I could try to make a pull request : )
+1 for addition of callbacks :-)
that would be a nice feature!
I would suggest to use jQuery event namespaces: $(w).trigger("complete.picturefill");
might look something like this:
I prefer a dot instead of colon, but both would be okay
fixed my example above... the . is the offical jquery way.. thanks @ixisio
I don't think this should be done with jQuery. Keep it decoupled from jQuery.
@u982744 you 're absolutely right.
think we can close this issue, the correct approach already exists #60.
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
Trigger event on picturefill completion, see trigger complete event (…