Comments (1)
@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.
from retinajs.
Related Issues (20)
- Why does the LESS mixin set background-size?
- `exports = {}` is not added in non-minified dist files HOT 3
- How to discard SVG images to try loading @2x? HOT 1
- Cannot minify JS for retina.js HOT 2
- Uncaught ReferenceError: exports is not defined at retina.js:12 HOT 9
- The minified version has a bug: OnLoad event does not process any images HOT 4
- Is it another bug (except the exports)?
- devicePixelRatio rounding
- (2.1.0) Not works on mobile IE10 HOT 1
- retinajs should not be defining "exports" if it isn't available
- Refresh retinajs after img src changed HOT 1
- retina.js runs automatically despite using import or require HOT 2
- How to re-initialize script on already processed images? HOT 2
- <img src="/images/my_image.png" data-rjs="/images/2x/my-image.png" />
- Support for 2x & 3x through data attributes HOT 3
- if i dontβt load 1.x image will cause the waste of resources
- Download Button Goes Wrong Version of Retina.js
- Readme issue HOT 1
- Is it compatible with lazysizes ?
- =
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from retinajs.