russellsamora / enter-view Goto Github PK
View Code? Open in Web Editor NEWDependency-free JavaScript library to detect when element enters into view
Home Page: https://russellgoldenberg.github.io/enter-view/
License: MIT License
Dependency-free JavaScript library to detect when element enters into view
Home Page: https://russellgoldenberg.github.io/enter-view/
License: MIT License
It would be nice to add a d.ts file to support Typescript out of the box.
Here's the d.ts file I created:
declare module 'enter-view' {
export interface EnterViewArgs {
selector: NodeListOf<Element> | Element | string;
enter?: (el: Element) => void;
exit?: (el: Element) => void;
progress?: (el: Element, progress: number) => void;
offset?: number;
once?: boolean;
}
const enterView: (args: EnterViewArgs) => void;
export default enterView;
}
For anyone stumbling on this post if this doesn't make it into the package;
just add the above to your custom typings folder in a file called enter-view.d.ts
and you are good to go.
Love your work. I would like to add an attribute rather than a class .entered. Is it possible ?
Here is the attribute :
transition-style="in:wipe:up"
Thanks !
Hi !
Is there a way to make it detecting if an element enter to viewport even when I'm scrolling from bottom to top ?
Currently, as far as I understand, it only works scrolling from top to the bottom of the page.
Is there a way to make it work on both sense ?
Thanks for your feedback.
Best !
Hi,
How can I force this to load with ajax content being added?
Cheers
Andy
Hello, love your plugin Scrollama! I noticed a similar API, should we be using this framework instead?
Thank you :)
Keep listening elements appearance after first time they trigger.
Hi, this is a great library. I'm not sure if this is expected behaviour, but if i have an element that scrolls into view, the enter event is fired as expected. If i keep scrolling so that the element disappears out the top of the viewport, the exit event is not fired, its only fired when i scroll back up past the element and it disappears out the bottom of the viewport. Is this as intended? Is there a way to make it detect whether it has exited either the top and bottom of the viewport so I can tell if it is currently in view right now or not?
Can you add a way to clean up the function so it stops listening? Even when we set "once" to be true, the listeners added to window remain.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.