Quantcast
Viewing all articles
Browse latest Browse all 175

Introducing ScrollMagic 2.0

If you’re desperate to generate beautiful scroll animations in your next project, then look no further. ScrollMagic is a JavaScript library to help you create “magical” scroll interactions which effortlessly react to the user’s current scroll position and trigger animations or synchronized events.  ScrollMagic recently underwent some big changes, so here’s a quick walk-through discussing the changes and improvements since its rebirth. The ScrollMagic homepage What’s New? Dependencies that were once core components of ScrollMagic , like GreenSock (GSAP) and jQuery, have been removed entirely from the library. As of 2.0.0 everything that adds features on top of ScrollMagic is treated as a plugin, finally making ScrollMagic a standalone library (6KB gzipped)!  The Changelog contains many other facets that have been adjusted, should you choose to dive deeper. In case you don’t have the time, here’s a list highlighting some of the changes: Removal of dependencies and introducing plugins Controllers are now instantiated using ScrollMagic.Controller() Scenes are now defined as ScrollMagic.Scene() Removal of triggerOffset Removal of pinClass (this can be achieved with setClassToggle in 2.0) pushfollowers default value is set to false New events: add and remove Renamed .parent to .controller Debug extension renamed to plugins/scene.addIndicators and can be added before the controller and works even when scenes are removed and re-added. New method removeIndicators Performance Tweaks Performance tweaks improving the speed of ScrollMagic were suggested by Paul Irish in regards to updating RAF ( request animation frame )

Viewing all articles
Browse latest Browse all 175

Trending Articles