Jump to content
GreenSock

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

minimumMovement doesn't work

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

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

Have you tried setting dragClickables:true? 

 

No, I havn't. I tried it and now it works!

I should have read full Documentation on Draggable before asking here. I just read features on the Draggable page and didn't move further.

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.

×