ryanve / response.js

Responsive design toolkit
http://responsejs.com
Other
801 stars 123 forks source link

Callback when src changes the first time #41

Open microcipcip opened 10 years ago

microcipcip commented 10 years ago

Is there a callback that fires when the src has changed for the first time? I have a image wrapped with a span, I use this wrapper to display a preloader gif, however I don't know how I should remove the animation once that the full resolution image has finished loading.

Example:

<span class="preloader"><img src="40x40.jpg" data-image-400="400x400.jpg" data-image-800="800x800.jpg" alt="#" /><span>
ryanve commented 10 years ago

We don't have a specific event for it yet but this sort of feature is on the roadmap for the future—see #15 and other open issues. For now does running your callback immediately after response.js runs help?

microcipcip commented 10 years ago

I will check that code, thanks for your help!