Jump to content
Search Community

minimumMovement doesn't work

Aleksei test
Moderator Tag

Go to solution Solved by Carl,

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

Hi, guys!

I have a problem with minimumMovement parameter in Draggable.

There is a site menu with several clickable links. I want to be able to drag the entire menu even if mouse cursor (or touch) is above the <a> element. But now I can drag it only if I press on empty area of the menu.

You can check the actual version right here: http://nordskill.com/dock/argish/index-about-us.html

But you have to squeeze the browser window to "mobile" width to see what I'm talking about.

 

l3vRhsAhxUF8lkCis.gif

 

 

The DOM structure looks like this:

<menu class="nav">
   <ul>
      <li><a href="#">btn name</a></li>
      <li><a href="#">btn name</a></li>
      <li><a href="#">btn name</a></li>
      <li><a href="#">btn name</a></li>
   </ul>
</menu>

JS:

Draggable.create(".nav", {type:"x", edgeResistance:0.75, throwProps:true, minimumMovement:2, bounds:window});
Link to comment
Share on other sites

  • Solution

Have you tried setting dragClickables:true? 

 

dragClickables : Boolean - By default, Draggable will ignore clicks on <a>, <input> <select>,<button>, and <textarea> elements (as well as any element that has a data-clickable="true"attribute), allowing the browser's default behavior (like clicking on an input would give it focus and drop the cursor there to begin typing), but if you want Draggable to hijack those clicks and initiate dragging instead, set dragClickables:true.

 

http://greensock.com/docs/#/HTML5/Drag/Draggable/

 

If it still doesn't work it would help greatly if you could create a reduced CodePen example as explained here:

 

http://greensock.com/forums/topic/9002-read-this-first-how-to-create-a-codepen-demo/

 

Thanks!

  • Like 2
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...