开发者

Jquery, getting DIV ID as it is being dragged using "draggable"?

开发者 https://www.devze.com 2023-01-08 07:17 出处:网络
I found another post about this but the solution there isn\'t working for me... I am trying this (having already instantiated the draggable option separatel开发者_StackOverflowy:

I found another post about this but the solution there isn't working for me... I am trying this (having already instantiated the draggable option separatel开发者_StackOverflowy:

 $( ".masker" ).bind( "drag", function(event, ui) {

  testdragging =    ui.draggable.attr('id') ;


}); 

Just calling this: ui.draggable.attr('id') ; makes the entire class of DIV not draggable, if I simply remove this then it works fine, just can't figure this out, any advice is appreciated.


In the case of draggable (not viewing it from the droppable side) it's ui.helper instead of ui.draggable, like this:

$(".masker").bind("drag", function(event, ui) {
  testdragging = ui.helper.attr('id');
}); 

You can test it out here.

0

精彩评论

暂无评论...
验证码 换一张
取 消