Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does retinajs support external trigger of the plugin instead of onload? #14

Closed
DaFrik opened this issue Apr 19, 2012 · 1 comment
Closed
Labels

Comments

@DaFrik
Copy link

DaFrik commented Apr 19, 2012

As I might have images being loaded and inject into the page dynamically, does retinajs support that or is there an API call that i could trigger retinajs externally ?

Thanks

@caseyohara
Copy link
Contributor

@DaFrik We're trying to keep the script zero-config, but by coincidence exposed an API with some new features we just added. Be sure to download the latest copy to try it out.

In your script, you can call new RetinaImage(img) where img is a raw DOM image element (not a jQuery object).

In case you're interested, we're also currently experimenting with writing on a jQuery plugin to act as a nice wrapper for the script. It isn't fully tested, but you can try using it (we'd love to have you help us test it). It's currently on the feature/jquery-plugin branch or you can download a compiled version here.

You can call it like this: $('img').retina();. In your case, you'll want to make that call inside the callback of whatever you're using to inject the elements onto the page dynamically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants