Jump to content
Search Community

Draggable on Anchor Tag

Joe Hakooz test
Moderator Tag

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

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

  • 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.
×
×
  • Create New...