Comments (2)
@nikolaydyankov Yes, it does not automatically detect when new content has loaded, but we do have a means for refreshing the script.
See issue #14 for details on that.
Basically, the callback for the function that is loading in more content, you can to feed it any the new images on the page that you want swapped in.
In your case, you can modify your $.post
callback in your make_request()
function to look something like this:
$.post(
MyAjax.ajaxurl,
{
action : 'load_projects',
cat : cat
},
function(data) {
productsWrap.append(data);
$('img').each(function(){
new RetinaImage(this);
});
loader.hide();
}
);
The important bit is this here:
$('img').each(function(){
new RetinaImage(this);
});
Let us know how this works for you or if you have any ideas of how to make it easier to use.
from retinajs.
Worked perfectly, thanks! Great job with this script.
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.