Jump to content

dwillis

Members
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

0 Newbie

About dwillis

  • Rank
    Newbie
  1. Ah, I hadn't realized. I love an easy fix! Thank you!
  2. Hi! I'm using GSAP with ScrollMagic on a one-page site I'm developing. To scroll to a particular section I'm using the scrollTo plugin and it's working great but I need it to have an offset when it scrolls so the heading doesn't scroll under the nav. scrollTo helpfully provides an 'offsetY' property but for some reason it's not working for me. No matter what offset I put in, it scrolls to the same position. There are no console errors though. You can see it not working on the linked codepen demo. Here's the specific line: TweenMax.to(window, 0.5, {scrollTo: {y: newpos, offsetY:70}}); Any idea what I'm doing wrong? TIA! David
  3. I've just realized that it works when I use this.target in my actual callback, which must be what you meant. Thank you!
  4. Hi Diaco! Thanks for the quick response! I tried this: TweenLite.to($("#content li")[i], 1, {top:"150%", onCompleteScope:this.target, onComplete:function(){ console.log(this); //appears to be TweenLite object }}); It seems like this gives me the same result as leaving off the onCompleteParams and onCompleteScope parameters all together.
  5. Hi! I'm new to GSAP (and loving it!) and I'm trying to figure out how to pass a reference to the DOM element I'm tweening to the onComplete function. I've tried the following: TweenLite.to($("#content li")[i], 1, {top:"150%", onCompleteParams:[lmnt], onComplete:function(){ console.log(lmnt); //Uncaught ReferenceError: lmnt is not defined }}); TweenLite.to($("#content li")[i], 1, {top:"150%", onCompleteParams:["lmnt"], onComplete:function(){ console.log(lmnt); //Uncaught ReferenceError: lmnt is not defined }}); TweenLite.to($("#content li")[i], 1, {top:"150%", onComplete:function(){ console.log(this); //appears to be TweenLite object--instanceof HTMLElement is false }}); TweenLite.to($("#content li")[i], 1, {top:"150%", onCompleteScope:this, onComplete:function(){ console.log(this.toString()); //[object Window] }}); How can I pass reference the DOM element that just finished tweening? I'm trying to reset the top parameter to it's starting value so the next time it tweens it will be starting from the beginning instead of the end. Halp? Thanks!