Jump to content
php.lv forumi
  • 0

onDrop this id


Artenis

Question

SveikI!

Doma tāda, ka nesanāk iegūst ID objektam, kas tiek pārvelkot nomests (atlaists).

kā var redzēt ir viena klase, to objektu kustināšana strādā, viss ok, bet atlaižot man vajadzētu iegūt šī objekta, ko palaižu vaļā ID. Man viņš iegūst tikai paša pirmā DIV, id. piemēram: ja ir 10 divi, kurus var pārvilkt, tad man iegūst div1 id.

Paldies, ceru, ka domu sapratāt.

 

jQuery(function(){
// add drag and drop functionality to #box1

var obj = jQuery("div.note-block", this);
var objId=obj.attr("id");
var newId=objId.split("_");
 obj.easydrag();

// set a function to be called on a drop event
 obj.ondrop(function(e, element){ 
alert(newId[1]);
//updatePos(newId[1],e.pageX,e.pageY);
}
);
}); 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...