Open brittonk opened 6 years ago
You can try this. Not sure if it will work as first time I'm using this library now and trying it out.
var iframe = $('iframe');
var yourElement = $(iframe).contents().find('.yourelement');
$(yourElement).on('inview', function(event, isInView) {
if (isInView) {
// in-view
} else {
// off-view
}
});
I'm working on an app which this script works great on. Unfortunately, I've had to enclose everything in an iframe so that I can keep user uploads (photos/videos) continuing across page change in the app.
When inside the iframe, inview no longer works. Would there be an easy fix to get it to watch the iframe's content viewport?