Created
May 1, 2020 06:00
-
-
Save james0r/ac2f1ad5f3596551c17e340e2709b172 to your computer and use it in GitHub Desktop.
scrollmagic playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/1.14.2/TweenMax.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.3/ScrollMagic.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.3/plugins/animation.gsap.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.3/plugins/debug.addIndicators.js"></script> | |
<div id="container"> | |
<div id="block"> | |
Hi there ! | |
</div> | |
</div> | |
<script> | |
$(window).ready(function() { | |
var blockTween = new TweenMax.to('#block', 1.5, { | |
backgroundColor: 'red' | |
}); | |
var containerScene = new ScrollMagic.Scene({ | |
triggerElement: '#container' | |
}) | |
.setTween(blockTween) | |
.addIndicators() | |
.addTo(controller); | |
}); | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/ScrollMagic.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/plugins/debug.addIndicators.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#container { | |
margin: 55vh 0; | |
padding: 50px; | |
outline: 1px dashed orange; | |
} | |
#block { | |
padding: 10px; | |
border: 1px solid black; | |
font-family: Helvetica; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment