1 Replies - 9996 Views - Last Post: 14 March 2012 - 03:24 AM

#1 hockey97   User is offline

  • D.I.C Regular

Reputation: -77
  • View blog
  • Posts: 300
  • Joined: 25-September 08

drag and drop question jquery ui

Posted 13 March 2012 - 04:08 PM

Hi, how can you grab the id of a drop-able???

what I want to do is have all div's be droppables... and then when I drag a image to those div's I want to be able to first grab that div's id and actually insert the image inside this div.

So how can I detect what div the image is being dropped into???
Is This A Good Question/Topic? 0
  • +

Replies To: drag and drop question jquery ui

#2 chinchang   User is offline

  • Indie Game Developer
  • member icon

Reputation: 192
  • View blog
  • Posts: 727
  • Joined: 22-December 08

Re: drag and drop question jquery ui

Posted 14 March 2012 - 03:24 AM

When you make your DIVs droppable you can set a callback for the drop event inside which the DIV begin dropped into is available as this.

drop: function( event, ui ) {
   console.log(this);		
}


You might want to check here.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1