locomotive-scroll | 🛤 Detection of elements in viewport & smooth scrolling | Animation library

 by   locomotivemtl JavaScript Version: 4.1.4 License: MIT

kandi X-RAY | locomotive-scroll Summary

kandi X-RAY | locomotive-scroll Summary

locomotive-scroll is a JavaScript library typically used in User Interface, Animation, jQuery applications. locomotive-scroll has no bugs, it has a Permissive License and it has medium support. However locomotive-scroll has 8 vulnerabilities. You can install using 'npm i locomotive-scroll' or download it from GitHub, npm.

Detection of elements in viewport & smooth scrolling with parallax effects.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              locomotive-scroll has a medium active ecosystem.
              It has 6565 star(s) with 1087 fork(s). There are 71 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 219 open issues and 211 have been closed. On average issues are closed in 73 days. There are 15 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of locomotive-scroll is 4.1.4

            kandi-Quality Quality

              locomotive-scroll has 0 bugs and 0 code smells.

            kandi-Security Security

              locomotive-scroll has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              OutlinedDot
              locomotive-scroll code analysis shows 8 unresolved vulnerabilities (8 blocker, 0 critical, 0 major, 0 minor).
              There are 0 security hotspots that need review.

            kandi-License License

              locomotive-scroll is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              locomotive-scroll releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions, examples and code snippets are available.
              locomotive-scroll saves you 2370 person hours of effort in developing the same functionality from scratch.
              It has 5169 lines of code, 0 functions and 129 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed locomotive-scroll and discovered the below as its top functions. This is intended to give you an instant insight into locomotive-scroll implemented functionality, and help decide if they suit your requirements.
            • Polyfill for browser support
            • Initialize the scripts .
            • Determines whether the browser is natively .
            • Virtual scroll mode .
            • scroll event handler
            • Initialize a new Leawer
            • Loads and stylesheets .
            • Build the styles .
            • Build scripts .
            • Convert iterable to an array
            Get all kandi verified functions for this library.

            locomotive-scroll Key Features

            No Key Features are available at this moment for locomotive-scroll.

            locomotive-scroll Examples and Code Snippets

            Getting Started,Installation
            TypeScriptdot img1Lines of Code : 2dot img1License : Permissive (MIT)
            copy iconCopy
            $ npm install locomotive-scroll react-locomotive-scroll
            
            $ yarn add locomotive-scroll react-locomotive-scroll
              

            Community Discussions

            QUESTION

            Scrollbar not scrolling completely down the page while using locomotive scroll
            Asked 2022-Apr-10 at 03:15

            I will try ti keep it as simple as possible! This is my first time using locomotive scroll while I am testing my code out I am not able to scroll all the way below. The scroll bar is visible but but I am not able to scroll or drag it using the mouse. I seriously spend hours to find any solution for this issue here but had no success yet. It will be great if someone can help me out to solve this issue here. Thank you for your time

            ...

            ANSWER

            Answered 2022-Apr-10 at 03:15

            I found the solution for this problem it was actually the position property in CSS as you see here I added a class called text

            Source https://stackoverflow.com/questions/71808878

            QUESTION

            GSAP ScrollTrigger animations not working with Locomotive JS (until window is resized)
            Asked 2022-Jan-23 at 15:37

            I have sections across my site which are using ScrollTrigger. Once I implemented Locomotive JS, all of my ScrollTrigger animations stopped working.

            I read through the forums and saw that you need to update() ScrollTrigger when Locomotive is scrolling. I implemented this and saw no results.

            Then, I resized the window and my ScrollTrigger animations that were in view, they started working.

            In short, animations trigger on resize, but not on page load.

            I've implemented update() and also tried refresh(), but no luck.

            Demo (fiddle showing issue here also):

            ...

            ANSWER

            Answered 2022-Jan-23 at 15:37

            These are what I've tried to get the animation run.

            1. Let ScrollTrigger know about the new scroller.

            As you're using Locomotive scroll that means the native scroll which ScrollTrigger is based on is removed. So we bring it back by doing this:

            Source https://stackoverflow.com/questions/70748627

            QUESTION

            Uncaught (in promise) TypeError: _this.settings is not a function - Working with barba.js and three.js
            Asked 2021-Aug-26 at 23:21

            I'm developing a site using barba.js. In this page, "slider", I have a three.js scene. If I open up the page everything is fine. If I navigate from slider to home and then come back to slider page, I got this error:

            Uncaught (in promise) TypeError: _this.settings is not a function

            The script that controls the slider page is Sketch.js.

            ...

            ANSWER

            Answered 2021-Aug-26 at 23:21

            Your problem appears to be with the following class method...

            Source https://stackoverflow.com/questions/68934954

            QUESTION

            How to correctly use Locomotive Scroll with Next.js routing?
            Asked 2021-Jul-12 at 14:01

            I'm using locomotive-scroll with Next.js and all working fine. But after route to a different page, my scroll won't destroy and 2 scrolls overlap each other.

            How to correctly reinit locomotive-scroll in Next.js after route?

            My code example:

            ...

            ANSWER

            Answered 2021-Jul-12 at 13:56

            You should move the scroll.destroy call to the cleanup phase of the useEffect. You also don't need to explicitly call scroll.init().

            Source https://stackoverflow.com/questions/68264720

            QUESTION

            importing a js file that has import at it's top
            Asked 2021-Jan-23 at 19:35

            I want to import a file that imports another file to be able to use it on multiple pages

            folder structure

            ...

            ANSWER

            Answered 2021-Jan-23 at 19:35

            I believe that in order for these imports to work correctly, you'll need to include type="module" in the html script tag. Like this:

            Source https://stackoverflow.com/questions/65863457

            QUESTION

            Three.js - stop rendering scene when not visible / out of viewport
            Asked 2020-Oct-13 at 03:00

            I'm making a website that uses a lot of js and animations and first section is fullscreen three.js scene which is moving with mouse movement. Scene itself is fine but everyting is being rendered all the time even when im not looking at the three.js webgl canvas and it's making performace problems, while other animations are happening lower on the website.

            I need to stop rendering scene completely while scene is not in viewport and that will boost pewrformacne drastically.

            Here is render function:

            ...

            ANSWER

            Answered 2020-Oct-13 at 02:08

            You can use an IntersectionObserver to get an event when an element is on/off screen.

            Source https://stackoverflow.com/questions/64326977

            QUESTION

            Show element when in viewport (Locomotive Scroll)
            Asked 2020-Apr-10 at 15:25

            I'm using Locomotive Scroll on a website. What i try to achieve is the following : when a section with the id #mysection is in the viewport, i'd like an icon to appear, then disappear when the section is out of the viewport.

            I've tried searching in the docs and on the web ways to achieve this, but i can't figure out how to make it work. Right now, i've seen that you can launch events in the docs by using the following :

            ...

            ANSWER

            Answered 2020-Apr-10 at 15:25

            To quickly answer the questions about the "is-inview" class not being removed, you need to include the "data-scroll-repeat" attribute to the element.

            eg:

            content

            Regarding controlling when it triggers, I'd look at the data-scroll-offset="?, ?"

            In the docs is says the 1st is bottom (when the elements enters) and 2nd is top (when the element exits). Can be a number for pixels or a percentage.

            Hope that helps for part of your question at least.

            Source https://stackoverflow.com/questions/61027755

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install locomotive-scroll

            ⚠️ Scroll-hijacking is a controversial practice that can cause usability, accessibility, and performance issues. Please use responsibly.

            Support

            Works on most modern browsers. Chrome, Firefox, Safari, Edge... To get IE 11 support, you need polyfills. You can use your own or include these before our script.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i locomotive-scroll

          • CLONE
          • HTTPS

            https://github.com/locomotivemtl/locomotive-scroll.git

          • CLI

            gh repo clone locomotivemtl/locomotive-scroll

          • sshUrl

            git@github.com:locomotivemtl/locomotive-scroll.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link