javascript - Scrollmagic: issue with animating content inside parallax sections -


i'm experimenting parallax , scrollmagic. in parallax example scrollmagic demo i'm trying animated content in first parallax section.

here's a fiddle of experiment.

i can't letter a in #box move how want it. i'd tried adding bounding box , using triggerelement, did not work.

on scrolldown should move down 150px , fade out. right it's using "#parallax1" triggerelement , fading out once reaches bottom of section. want fade out before bottom of section. how that?

what doing wrong?

////////////////////////////////////////////////////// ////////////   //// parallax animation    //////////// //////////////////////////////////////////////////////  // init controller var controller = new scrollmagic.controller({     globalsceneoptions: {         triggerhook: "onenter",         duration: "200%"     } });  // build scenes // build tween1 var tween1 = new timelinemax(); tween1.to("#parallax1 > div", 1, {     y: "80%",     ease: linear.easenone });  var scene = new scrollmagic.scene({     triggerelement: "#parallax1" })     .settween(tween1)     .addindicators()     .addto(controller);  new scrollmagic.scene({     triggerelement: "#parallax1" })     .settween("#box", 0.10, {     alpha: 0,     ypercent: 0,     y: "800%",     ease: linear.easenone })     .addindicators()     .addto(controller);  new scrollmagic.scene({     triggerelement: "#parallax2" })     .settween("#parallax2 > div", {     y: "80%",     ease: linear.easenone })     .addindicators()     .addto(controller);  new scrollmagic.scene({     triggerelement: "#parallax3" })     .settween("#parallax3 > div", {     y: "80%",     ease: linear.easenone })     .addindicators()     .addto(controller);  /////----  end parallax animation  ---------------------------------------------->> 

maybe can use element position relative of #parallax1 put (example) 20px above bottom of #parallax1 , use trigger


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -