Giter VIP home page Giter VIP logo

enter-view's People

Contributors

gabrielflorit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

enter-view's Issues

Typescript support

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.

Add attribute rather than a class

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 !

Detect also when scrolling from bottom to top

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 !

VS Scrollama

Hello, love your plugin Scrollama! I noticed a similar API, should we be using this framework instead?

Thank you :)

Exit viewport only called when element passes out the bottom of the viewport?

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?

Remove all listeners

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.