Coder Social home page Coder Social logo

scrollmagic's Introduction

#ScrollMagic Donate

###The jQuery plugin for magical scroll interactions.

ScrollMagic is a jQuery plugin which essentially lets you use the scrollbar like a progress bar.
It's the plugin for you, if you want to ...

  • ... start an animation at a specific scroll position.
  • ... synchronize an animation to the scrollbar movement.
  • ... pin an element at a specific scroll position (sticky elements).
  • ... pin an element for a limited amount of scroll progress (sticky elements).
  • ... easily add a parallax effect to your website.
  • ... create an inifinitely scrolling page (ajax load of additional content).
  • ... call functions when the user hits certain scroll positions or react in any other way to the current scroll position.

Check out the demo page, browse the examples or read the documentation to get started.

##About the Plugin

ScrollMagic is a complete rewrite of its predecessor Superscrollorama by John Polacek.
Like Superscrollorama it relies on the Greensock Animation Platform (GSAP) to build animations, but was developed with specific regard to former shortcomings.

The major perks of using ScrollMagic include:

  • optimized performance
  • flexibility
  • mobile compatibility
  • ready for responsive webdesign
  • object oriented programming and object chaining
  • event management
  • support for both scroll directions (even different on one page)
  • support for scrolling inside div containers (even multiple on one page)
  • extensive debugging and logging capabilities

Installation

Aside from jQuery make sure you have loaded the Greensock Animation Plattform (TweenMax).
To use ScrollMagic in your project simply include the plugin js file in the head section of your HTML file:

<script type="text/javascript" src="js/jquery.scrollmagic.js"></script>

For deployment use the minified version instead:

<script type="text/javascript" src="js/jquery.scrollmagic.min.js"></script>

And to have access to the debugging extension during development, include this file additionally:

<script type="text/javascript" src="js/jquery.scrollmagic.debug.js"></script>

You can remove the debugging extension for actual deployment.

Usage

// init controller
var controller = new ScrollMagic();

// assign handler "scene" and add it to Controller
var scene = new ScrollScene({duration: 100})
				.addTo(controller);

// add multiple scenes at once
var scene2;
controller.addScene([
	scene, // add above defined scene
	scene2 = new ScrollScene({duration: 200}), // add scene and assign handler "scene2"
	new ScrollScene({offset: 20}) // add anonymous scene
]);

Check out the examples or the documentation for full reference.

##Browser Support

ScrollMagic aims to support all major browsers in recent versions:
Firefox 26+, Chrome 30+, Safari 6+, Opera 19+, IE 9+

##About the Author

I am a freelance Art Director based in Vienna, Austria (soon Lausanne, Switzerland).
I started this project to intensify my knowledge of javascript.

Check out my website or Follow me on Twitter

##License

ScrollMagic is dual licensed under the MIT license and GPL.
For more information click here.
Click here to get more information on greensock licensing.

scrollmagic's People

Contributors

janpaepke avatar johnpolacek avatar mattgrayisok avatar gagarine avatar softvar avatar kevinhamiltonsmith avatar lucanos avatar masudo avatar swalkinshaw avatar zeevl avatar

Watchers

James Cloos avatar  avatar

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.