javascript - Skrollr relative positions not working -
i need able move div 1 100% height div fixed position in 100% height div. using relative positions not know how big div is. doing wrong, skrollr documentation confuses me. here code using try , solve issue.
data-0="transform: translate(0,0vh);" data-center="transform: translate(0,100vh);
here reduced test case: http://codepen.io/simonfricker/pen/kvmpaz
html
<section class="block hero"> <div class="container"> <div class="happy" data-0="transform: translate(0,0vh);" data-top-top="transform: translate(0,10vh);">😃</div> </div> </section> <section class="block content"> <div class="container"> <p>happy face should end here on scroll</p> </div> </section>
css
html, body{ height:100% !important; } .block{ height:100%; } .hero{ background: red; } .content{ background: yellow; text-align: center; padding-top: 10%; } .happy{ font-size:250px; text-align: center; } p{ line-height:100%; }
js
var s = skrollr.init();
Comments
Post a Comment