Jump to content
GreenSock

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

Draggable on Anchor Tag

Recommended Posts

Pradeep sent me this private message. Moving it here in the forum...
 
I think you need to look at the dragClickables option.
 
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.
 
----------------
Hi,
When i apply draggable event on a anchor tag it does not nork for me.
eg:-
<div>text</div>-- it work for me

but when i add anchor tag on text
 
<div><a href="#">text</a></div>-- it not work for me

Here you can add anchor tag around the .dragclone div, then it does not work.


Thank You in advance.
Please help
~Pradeep

 

----------------------
 
 

See the Pen klanu by anon (@anon) on CodePen

  • Like 1
Link to comment
Share on other sites

I am having a difficult time deciphering this. 

The CodePen demo looks overly complicated for something that seems to involve asking about dragClickables.

 

It would be great if pradeep could create a simple CodePen that clearly illustrates the issue.

I suggest using one Draggable and NOT having all that logic in the onDrag.

 

thanks.

Link to comment
Share on other sites

Sounds like he spammed a bunch of us via PM. I got one too and responded directly. It's definitely better to bring the discussion into the public board so others can benefit too. Thanks for initiating that. 

Link to comment
Share on other sites

  • 2 weeks later...

Hi guys,

 

I apologize for the inconvenience.

I am finding the solution on Google and Stack Overflow as well but am not able to get that on time.

 

its work for me by adding dragClickables:true.

 

@OSUblake Great Example.

 

Thank You.

  • Like 1
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.
×