Jump to content

Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

aok's Achievements


Newbie (1/14)



  1. I'm running through a stack of images one after the other and it yoyo back which is repeated infinitely. The issue I'm having is that the first and last item (top and bottom in the stack) also fade to opacity 0 so you either get this weird blank space (if it's staggering top to bottom) or the top image fires too fast (if it's staggering bottom to top). What I'd like to achieve is if it's the last item in the stagger (working top to bottom) then it doesn't apply the opacity change (but the timing is the same so it treats it as if it was 'skipped' or 'not there') and then working bottom to top it hangs the image a little longer? I've managed to achieve this when staggering top to bottom (so it effectively ignores the last item) but how can do the same for the reverse direction so when it reaches the first item (and turns the opacity to 1) it hangs for a little longer on that image? var stack = new TimelineMax({ repeat: -1, yoyo: true }); stack.staggerTo('.parallax > div:not(:last)', 0.1, { opacity: 0, onComplete: function() { if (this.target == $('.parallax > div').first()[0]) { /* Below doesn't work */ stack.pause(); $(this.target).css('opacity', 1); } } }, 0.2);