Jump to content
Search Community

Agency Habitat

Business
  • Posts

    2
  • Joined

  • Last visited

Community Answers

  1. Agency Habitat's post in Update timelines when dragging was marked as the answer   
    Ok, I was able to figure this out. Or at least the next step...
     
    I was confused because ScrollTrigger's .progress() function is read-only. I couldn't figure out how to update it. Then I stumbled upon the fact that I didn't need to update the ScrollTigger; I just needed to update the tween. I'm still new at this stuff. but I think it makes more sense now. 
     
    I updated...
    function onDraggableDragHandler() { const draggablePercent = this.x/this.minX; const markerPx = marker.maxX * draggablePercent; gsap.to(markerElem, { x: markerPx }); } To...
    function onDraggableDragHandler() { const draggablePercent = this.x/this.minX; const markerPx = marker.maxX * draggablePercent; gsap.to(markerElem, { x: markerPx }); scrollTween.progress(draggablePercent); } It seems to work pretty well as I intended. Though the .marker needs some smoothing.
×
×
  • Create New...