javascript - 我们如何在拖放更改后保存 html 页面

标签 javascript css html drag-and-drop

我正在研究 html DnD 。我在互联网上看到了很多教程,并得到了一个示例 od DnD http://jsbin.com/axegem/1 。现在,在对这些页面的对象重新排序后,我想保存它,但我不知道如何才能做到这一点,请任何人都可以提供帮助。

谢谢!!

最佳答案

我做了更新:​​https://jsfiddle.net/f7fq7n94/

$("#draggable4").draggable({
    containment: "#containment-wrapper",
    scroll: false,
    stop: function (event, ui) {
        positions[this.id] = ui.position
        localStorage.positions = JSON.stringify(positions)
    }
});
$("#draggable5").draggable({
    containment: "#containment-wrapper",
    scroll: false,
    stop: function (event, ui) {
        positions[this.id] = ui.position
        localStorage.positions = JSON.stringify(positions)
    }
});

关于javascript - 我们如何在拖放更改后保存 html 页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37810012/

相关文章:

javascript - highchart 通过在下拉列表中选择月份来更改图表

javascript - 给定两个相同长度的数组,找到哪些元素是 "shifted"

php - 为站点抓取入口域

javascript - 如何使用javascript获取body标签的值?

javascript - jquery:如果链接有目标空白,则添加类?

html - 父子元素的css定位

html - 行高不影响我的应用程序中的任何内容

html - CSS 未显示在 outlook 中

javascript - 如何从字符串中去除具有属性的 HTML 标签?

php - 提交按钮不提交