Jump to content
Search Community

Using Draggable as scrollbar synchronized with Timeline

someguy test
Moderator Tag

Go to solution Solved by Diaco,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hello,

is there a possibility to manually set the position of my draggable element?

I want to use it as an scrollbar that move synchronized with my timeline and it should automatically get updated when the timeline continues.

 

Ive already added an onUpdate handler to my timeline and an onDrag handler to my draggable with all the calculations already implementet.

 

I just dont know how I can set the position of my draggable.

 

My Markup is the following:

<nav id="drag-nav">
  <div class="dragger"></div>
</nav> 

Javascript:

$dragNav = $("#drag-nav");
draggerInstance = Draggable.create(".dragger", {
  type: "y",
  bounds: $dragNav,
  onDrag: onDragHandler
})[0];
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...