You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 29, 2020. It is now read-only.
First thing, I want to thank you for creating, releasing and maintaining this library ! It's super useful !
I do have a question - perhaps it's an improvement if not implemented, I'm not sure - about the offset.
Actually I use inView to check when some specific elements enter in the viewport, without offset. I want to put an event on another element, but it needs to be at least at 300px from the bottom.
I've been trying a very "naive" approach:
inView('#element1').once('enter', function(){console.log('visible without offset');});
inView.offset({bottom:300});
inView('#element2')
.once('enter', function(el){
console.log('visible with offset');
});
As far as I can see, this approach is not working (and I'm not very surprised) as inView use a global state. Is there a way to declare an offset on a specific element ?
Thanks for your feedback.
If not implemented yet, I'll try to do that if you'd like,
Xavier.
The text was updated successfully, but these errors were encountered:
@xavierleune At the moment, I'm rewriting in-view to be a thin wrapper around the IntersectionObserver API. So, I don't anticipate merging a lot of changes.
You're right that in-view isn't great for this use case. It was originally designed to be configured globally. If I were you, I'd consider using IntersectionObserver directly and polyfilling for whatever support you need.
Otherwise, if you can wait a bit, I'm hoping to have the new implementation done soon. That will support per-element configuration. Hope that helps!
@camwiegert All right, thanks for your feedback !
For now, I'll try to postpone the need of a per-element configuration and to wait for the new implementation !
Hi @camwiegert
First thing, I want to thank you for creating, releasing and maintaining this library ! It's super useful !
I do have a question - perhaps it's an improvement if not implemented, I'm not sure - about the offset.
Actually I use inView to check when some specific elements enter in the viewport, without offset. I want to put an event on another element, but it needs to be at least at 300px from the bottom.
I've been trying a very "naive" approach:
As far as I can see, this approach is not working (and I'm not very surprised) as inView use a global state. Is there a way to declare an offset on a specific element ?
Thanks for your feedback.
If not implemented yet, I'll try to do that if you'd like,
Xavier.
The text was updated successfully, but these errors were encountered: