strues / retinajs

JavaScript, SCSS, Sass, Less, and Stylus helpers for rendering high-resolution image variants
http://retinajs.com
MIT License
4.42k stars 610 forks source link

How to re-initialize script on already processed images? #281

Closed dgobnto closed 6 years ago

dgobnto commented 7 years ago

If you're using such plugins like Fondation's Interchange, an image might be replaced on the fly, after screen size change.

The data-rjs-processed="true" attribute will then prevent any previously processed image from being processed again (even if they are now new unprocessed images).

Is there any option to re-initialize retinajs on already processed images?

Thanks

dgobnto commented 6 years ago

I have had this issue in 2017 and now again, with a new project.

Is there any native method to re-process previously processed images?

Thank you.

mischaherbrand commented 6 years ago

@dgobnto: If you can detect the change you just need to call the function window.retinajs() and the script will be launched again. This also happens when you have a single page application.