0

I am using the following answer to solve my problem, however, it always registers either two clicks or two drags instead of just one. What could be the problem for that?
https://stackoverflow.com/a/31080629/5632752
The div that I am using the .draggable() function on looks like this:

<div id="draggable"><div>Hello World</div></div>
Community
  • 1
  • 1
Monil
  • 169
  • 1
  • 1
  • 11
  • Did you call the `.on("mousedown")` init twice? Can you recreate the issue either here in a snippet or on something like jsfiddle? – freedomn-m May 19 '17 at 15:27
  • Did you use the answer you linked to or the accepted answer on the question? – freedomn-m May 19 '17 at 15:28
  • I used the answer that I linked to, however I think it was not working correctly because I have two `$(document).ready()` functions which both did different things, so it registered two clicks. I put the code under a ` – Monil May 19 '17 at 15:32
  • Glad you got it sorted. – freedomn-m May 19 '17 at 15:38

1 Answers1

0

I had the code for differentiation under $(document).ready() and that, for some reason, registered two clicks instead of one. I added the code under a <script> tag at the end of the HTML page and now it works just as it should.

Monil
  • 169
  • 1
  • 1
  • 11