2
如果我將FX 1-5頂端我創造了這個jstree 3得到
jQuery(function($) {
$(document).on('dnd_stop.vakata', function(e, data) {
var origin = $(data.element);
var target = $(data.event.target);
// Missing something here to get if the origin is before or after the target
$('#result').html(
'<div><b>Target:</b> ' + target.html() + '</div>' +
'<div><b>Origin:</b> ' + origin.html() + '</div>'
);
})
$('#jstree_demo').jstree({
"core" : {
"check_callback" : true,
"themes" : { "stripes" : true },
},
"plugins" : [
"dnd"
]
});
});
現在當目標得到了下降的位置,目標是1-1 但如果我將fx 1-5移到底部,目標是1-8
有沒有什麼方法可以找出原點是在目標之前還是之後?