我正在使用jquery draggable我当前的项目,我有一个关于例如jquery draggable的问题;我从列表中拖放一个项目b列表,但是在这一点上出现问题。如果我的列表很长,那么y轴就会出现问题。可拖动的项目出现在光标下。
$(function () {
$( "#list1 li" ).draggable({
cursor: "move",
appendTo: "body",
helper: "clone"
});
$( "#list3" ).droppable({
activeClass: "ui-state-default",
hoverClass: "ui-state-hover",
accept: ":not(.ui-sortable-helper)",
drop: function( event, ui ) {
$( "<li></li>" ).text( ui.draggable.text() ).appendTo( this );
ui.draggable.remove();
$.ajax({
url: "@Url.Action("AddTag", "Home")",
type: "POST",
dataType: "json",
data: { tagId: ui.draggable.attr("data"),Id:@ViewContext.RouteData.Values["id"] },
success: function (data) {
},
error: function () {
}
});
},
});
$( "#list3 li" ).draggable({
cursor: "move",
appendTo: "body",
helper: "clone",
stop:function(event,ui){
$(this).remove();
$.ajax({
url: "@Url.Action("DeleteTag", "Home")",
type: "POST",
dataType: "json",
data: { tagId: $(this).attr("data"),Id:@ViewContext.RouteData.Values["id"] },
success: function (data) {
},
error: function () {
}
});
}
});
});