嗨,我想将丢弃的项目的位置保存到数据库[aspx,javascript].用户可以删除任意数量的项目,调整大小并删除[隐藏],最后当他们点击"保存"按钮时,它应该保存到数据库中.我有代码在drop/stop中执行此操作,但它将保存我想要仅在最后阶段保存的所有丢弃的项目.我想很多开发人员应该已经这样做了,所以请建议一些代码.
$(function() {
$('#frame img').live('mousemove', function(event) {
$('#frame img').resizable().parent().draggable();
});
});
$(function() {
$('#frame img').live('dblclick', function(event) {
// $(this).resizable("destroy") not working
$(this).hide();
//$(this).unbind("resizable"); not working
//$(this).removeclass(); not working
});
});
$(document).ready(function() {
//Counter
counter = 0;
//Make element draggable
$("img").draggable({
helper: 'clone',
containment: '#frame',
//When first dragged
stop: function(ev, ui) {
var pos = $(ui.helper).offset();
objName = "#clonediv" + counter
$(objName).css({ "left": pos.left, "top": pos.top });
$(objName).removeClass("drag");
//When an existiung object is dragged
$(objName).draggable({
containment: 'parent',
stop: function(ev, ui) { …Run Code Online (Sandbox Code Playgroud)