Jump to content

Dragging and dropping with jQuery. A .draggable() question.


sepoto
 Share

Recommended Posts

I am now familiar with the existence of the ".draggable()" function of jQuery. I am mulling over how I would integrate the dragging and dropping of an element into an event listener like this one:

google.maps.event.addListener(myMap, 'click', function(myEvent){var myClickLatLng=myEvent.latLng;// now process myClickLatLng});

First I am wondering if the dragging and dropping of an element would constitute a 'click' and second if the click event is fired how am I to know which element was dropped? Again I thank all of you for your time and wisdom. I am hoping my post is in the right forum as this is for JavaScript which is closely related. Thank You!

Edited by sepoto
Link to comment
Share on other sites

It looks like the best example I have found is located here and uses specifically the jQuery UI library. It looks like some good code. http://jqueryui.com/demos/droppable/ It also looks like the function can be modified like this:

drop: function(event, ui) {    alert($(ui).attr("id") + " was dropped");}

Edited by sepoto
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
 Share

×
×
  • Create New...