我尝试在网格系统行上拖动div
,然后找出他放置后的女巫行:
https://jsfiddle.net/johnidevo/08f83op9/5/
________________________________________________
droppable_area_(grids)__________________________
1row____________________________________________
2row____________________________________________
3row___-----------------------------------------
4row___| draggable <div> |
5row___| |
6row___-----------------------------------------
7row____________________________________________
(<div>'s)_______________________________________
我的代码如下:
jQuery( object ).draggable({
snap: ".selectable",
containment: "#droppable_area",
axis: "y",
drag: function( event, ui ){
console.log( jQuery( this ).parent() );
}
});
jQuery('.selectable').droppable({
drop: function( event, ui ) {
console.log( jQuery( this ) );
}
});
在Droppable函数console.log( jQuery( this ) );
中,它给出了一些正确的信息但不总是,为什么?
编辑:
console.log( jQuery( this ) );
当draggable <div>
只有一行高度时,@vid.tags.include? @tagfound
可以正常工作,如果大于1行大小,它会失败原因吗?