Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

added picturefill ready & update events and jslint fixes #60

Closed
wants to merge 2 commits into from

Conversation

u982744
Copy link

@u982744 u982744 commented Mar 1, 2013

Fires picture fill ready event first time, then picture fill update event subsequent times. Also updated picturefill code to pass jslint.

@christopherdarling
Copy link

any clues when this will be pulled in? would be a great feature to have...

@tjtate
Copy link

tjtate commented Nov 14, 2013

bump :)

@seafarer
Copy link

While this feature would be awesome, it breaks in IE8.

@4aficiona2
Copy link

Really looking for this feature to be able to lazyload the given image. How is the syntax to use picturefill_ready and picturefill_update?

@nwtn
Copy link

nwtn commented Jan 28, 2014

@zoo2rock if you're looking to lazyload, i have a branch at https://github.com/nwtn/picturefill/tree/resourcepriorities or https://github.com/nwtn/picturefill/tree/picturefull that takes a postpone attr to delay loading until the image is in the viewport.

@4aficiona2
Copy link

@nwtn thx, I will check out your branch. So far I determine the most dominant color (serverside), attach the color as BG-color to the picturefill span and lazyload (https://github.com/tuupola/jquery_lazyload) the responsive images/picturefill images. Because of my given setup I'm interested how to listen / define the callback for picturefill. Any suggestions? Thanks.

@4aficiona2
Copy link

@nwtn thx, looks great your fork!

@nwtn
Copy link

nwtn commented Jan 30, 2014

@zoo2rock great, glad it was helpful for you

@michaelplant-zz
Copy link

@u982744 - Great job on your update, I am looking for a way to have a callback triggered after the images are loaded. I think this is similar to #53 in that I am trying to determine maximum height of a set of divs.

After reading through the comments it sounds like the general consensus is to handle this separately than the picturefill itself. Any updates on your pull?

@u982744
Copy link
Author

u982744 commented Mar 2, 2014

I've made it work in IE8 now. You have to use the method picturefill.bind though. This is because a workaround needs to be used to allow custom events in IE8.

eg
picturefill.bind("picturefill_ready", function () {
alert("ready now!");
});

picturefill.bind("picturefill_update", function () {
alert("updated now!");
});

@SimonHarte
Copy link

Bump for merge, picturefill doesn't seem to work at all when I try to drop-in the forked version and we desperately need this.

@Wilto
Copy link
Collaborator

Wilto commented Apr 18, 2014

Hm, this one is tricky. It’s an easy enough change, but would take us back out of “polyfill” territory. In the case of the native picture, both of these events—one on initially loading the source and one when a new source is swapped in—would be handled by listening for a load event on the inner img. There won’t be anything in the way of custom picture events.

We’ll talk this one over internally and get back to everyone.

@scottjehl
Copy link
Owner

I agree. I think this is beyond scope for picturefill, and it won't apply in supporting browsers anyhow. but onload should allow for a similar handler, I think?

On Apr 18, 2014, at 3:50 PM, Mat Marquis notifications@github.com wrote:

Hm, this one is tricky. It’s an easy enough change, but would take us back out of “polyfill” territory. In the case of the native picture, both of these events—one on initially loading the source and one when a new source is swapped in—would be handled by listening for a load event on the inner img. There won’t be anything in the way of custom picture events.

We’ll talk this one over internally and get back to everyone.


Reply to this email directly or view it on GitHub.

@scottjehl
Copy link
Owner

Closing based on prior comment. Thanks!

@scottjehl scottjehl closed this Apr 21, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants