added picturefill ready & update events and jslint fixes #60

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
10 participants

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.

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

tjtate commented Nov 14, 2013

bump :)

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

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 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.

@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.

@nwtn thx, looks great your fork!

nwtn commented Jan 30, 2014

@zoo2rock great, glad it was helpful for you

@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 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!");
});

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.

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.

Owner

scottjehl commented Apr 18, 2014

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.

Owner

scottjehl commented Apr 21, 2014

Closing based on prior comment. Thanks!

@scottjehl scottjehl closed this Apr 21, 2014

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