1

I am currently developing a wordpress plugin. This plugin requires to drag certain items onto an image. The layout is like this:

enter image description here

And i need to save the points that are dragged onto the picture into the database. I also need the ability to edit the points or remove the points. Does anybody knows a good method of achieving this?

Kind regards, Jack

Edit:

Maybe i'm being a little bit vague about this, but all i need is suggestions.. I do not need people to write code for me.

Jack Sierkstra
  • 1,414
  • 2
  • 20
  • 42

3 Answers3

1

That's a lot you are asking eh, you can't expect us to write it for you but we can point your nose in the right direction :)

I suggest you start looking at the jQuery UI draggable plugin (and of course droppable too), it offers quite a flexible drag and drop implementation.

ChrisR
  • 14,370
  • 16
  • 70
  • 107
  • 1
    I am not expecting that either. To point me in the right direction is exactly what i need. I am just asking for suggestions, nothing more. – Jack Sierkstra Apr 25 '12 at 07:05
1

A google search gave me:

http://www.codingforums.com/showthread.php?t=160798
http://jquery-howto.blogspot.com/2009/07/identifying-locating-mouse-position-in.html
jQuery get mouse position within an element
http://www.switchonthecode.com/tutorials/jquery-snippet-relative-mouse-position

My suggestion is that onmouseup() you get the co-ordinates and store them.

A bit more googling and I found this answer:
Alternatives to trigger('mouseup') to stop dragging programmatically

Maybe this will help you.

Good luck :)

Community
  • 1
  • 1
Steven
  • 19,224
  • 47
  • 152
  • 257
0

Manipulate the jquery ui draggable plugin

http://jqueryui.com/demos/draggable/

gopi1410
  • 6,567
  • 9
  • 41
  • 75