Gathering detailed insights and metrics for scrollmagic
Gathering detailed insights and metrics for scrollmagic
Gathering detailed insights and metrics for scrollmagic
Gathering detailed insights and metrics for scrollmagic
The javascript library for magical scroll interactions.
npm install scrollmagic
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.1
Supply Chain
98.8
Quality
75.7
Maintenance
100
Vulnerability
93.6
License
JavaScript (87.66%)
HTML (6.19%)
CSS (6.16%)
Total Downloads
9,250,414
Last Day
6,715
Last Week
43,534
Last Month
194,390
Last Year
1,663,250
NOASSERTION License
14,958 Stars
670 Commits
2,161 Forks
320 Watchers
15 Branches
36 Contributors
Updated on May 10, 2025
Minified
Minified + Gzipped
Latest Version
2.0.8
Package Id
scrollmagic@2.0.8
Size
54.16 kB
NPM Version
6.14.7
Node Version
12.18.1
Published on
Nov 05, 2020
Cumulative downloads
Total Downloads
Last Day
24.2%
6,715
Compared to previous day
Last Week
-0.9%
43,534
Compared to previous week
Last Month
9.6%
194,390
Compared to previous month
Last Year
21.5%
1,663,250
Compared to previous year
27
Quicklinks: About | Download | Installation | Usage | Help | Compatibility | Author | License | Thanks
ScrollMagic helps you to easily react to the user's current scroll position.
It's the perfect library for you, if you want to ...
Check out the demo page, browse the examples or read the documentation to get started.
If you want to contribute please get in touch and let me know about your specialty and experience.
ScrollMagic is a scroll interaction library.
It's a complete rewrite of its predecessor Superscrollorama by John Polacek.
A plugin-based architecture offers easy customizability and extendability.
To implement animations, ScrollMagic can work with multiple frameworks. The recommended solution is the Greensock Animation Platform (GSAP) due to its stability and feature richness. For a more lightweight approach the VelocityJS framework is also supported. Alternatively custom extensions can be implemented or the necessity of a framework can be completely avoided by animating simply using CSS and class toggles.
ScrollMagic was developed with these principles in mind:
Is ScrollMagic the right library for you?
ScrollMagic takes an object oriented approach using a controller for each scroll container and attaching multiple scenes defining what should happen at what part of the page. While this offers a great deal of control, it might be a little confusing, especially if you're just starting out with javascript.
If the above points are not crucial for you and you are just looking for a simple solution to implement css animations I would strongly recommend taking a look at the awesome skrollr project. It almost solely relies on element attributes and thus requires minimal to no javascript knowledge.
To get your copy of ScrollMagic you have the choice between four options:
Option 1: GitHub
Download a zip file containing the source code, demo page, all examples and documentation from the GitHub releases page or clone the package to your machine using the git command line interface:
1git clone https://github.com/janpaepke/ScrollMagic.git
Option 2: Bower
ScrollMagic is also available on bower and will only install the necessary source code, ignoring all example and documentation files.
Please mind that since they are not core dependencies, you will have to add frameworks like GSAP, jQuery or Velocity manually, should you choose to use them.
1bower install scrollmagic
Option 3: npm
If you prefer the node package manager, feel free to use it.
Keep in mind that like with bower non-crucial files will be ignored (see above).
1npm install scrollmagic
Option 4: CDN
If you don't want to host ScrollMagic yourself, you can include it from cdnjs:
https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.8/ScrollMagic.min.js
All plugins and uncompressed files are also available on cdnjs.
For example:
https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.8/plugins/debug.addIndicators.js
https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.8/plugins/debug.addIndicators.min.js
Include the core library in your HTML file:
1<script src="js/scrollmagic/uncompressed/ScrollMagic.js"></script>
And you're ready to go!
For deployment use the minified version instead:
1<script src="js/scrollmagic/minified/ScrollMagic.min.js"></script>
NOTE: The logging feature is removed in the minified version due to file size considerations.
To use plugins like the indicators visualization, simply include them additionally to the main library:
1<script src="js/scrollmagic/uncompressed/plugins/debug.addIndicators.js"></script>
To learn how to configure RequireJS, when using AMD, please read here.
The basic ScrollMagic design pattern is one controller, which has one or more scenes attached to it.
Each scene is used to define what happens when the container is scrolled to a specific offset.
Here's a basic workflow example:
1// init controller 2var controller = new ScrollMagic.Controller(); 3 4// create a scene 5new ScrollMagic.Scene({ 6 duration: 100, // the scene should last for a scroll distance of 100px 7 offset: 50 // start this scene after scrolling for 50px 8}) 9 .setPin('#my-sticky-element') // pins the element for the the scene's duration 10 .addTo(controller); // assign the scene to the controller
To learn more about the ScrollMagic code structure, please read here.
To get started, check out the available learning resources in the wiki section.
Be sure to have a look at the examples to get source code pointers and make use of the documentation for a complete reference.
If you run into trouble using ScrollMagic please follow the Troubleshooting guide.
Please do not post support requests in the github issue section, as it's reserverd for issue and bug reporting. If all above options for self-help fail, please use Stack Overflow or the ScrollMagic Premium Support.
ScrollMagic aims to support all major browsers even in older versions:
Firefox 26+, Chrome 30+, Safari 5.1+, Opera 10+, IE 9+
I am a creative coder based in Vienna, Austria.
Learn more on my website or Follow me on Twitter
ScrollMagic is dual licensed under the MIT license and GPL.
For more information click here.
This library was made possible by many people who have supported it with passion, donations or advice. Special thanks go out to: John Polacek, Jack Doyle, Paul Irish, Nicholas Cerminara, Kai Dorschner, Petr Tichy and Dennis Gaebel.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 7/26 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
40 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More