malsup.github.com icon indicating copy to clipboard operation
malsup.github.com copied to clipboard

Trigger 'cycle-slide-before' before adding slide but after initial progressive/loader parse.

Open malacalypse opened this issue 9 years ago • 0 comments

Slides which contain or elements require polyfills on most browsers to work.

Since loader requires img.complete to return TRUE (and uses the img.load() handler to trigger adding the new slide) running the polyfill AFTER the new slide is in the DOM but BEFORE the slide has been processed further is necessary. I've added a new event, 'cycle-slide-before', to enable polyfills to run on slide data coming from progressive when loader is also enabled. It's been added as early as possible in this scenario, and find that it could also be of use if any other preprocessing of the raw slide object is necessary.

This callback isn't necessary in the normal add() function which is not overridden by the loader module, but as it is a useful trigger point, I've added it there as well for consistency.

Further, in -core and -loader I've also put the same changes, for consistency. I haven't updated -min, but can do if requested.

malacalypse avatar Jul 18 '14 13:07 malacalypse