我一直在尝试修补我的gridster的回调函数。我所要做的就是回调网格的位置,然后使用jquery的load函数,将其传递给另一个页面来存储和保存信息。但是,在使用此方法时,我要么返回错误,要么什么也不返回。当前代码如下
var gridster = $(".gridster").gridster({
widget_margins: [1, 1],
widget_base_dimensions: [318, 184],
serialize_params: function ($w, wgd) {
return {
id: wgd.el[0].id,
col: wgd.col,
row: wgd.row,
size_y: wgd.size_y,
size_x: wgd.size_x
}
},
widget_selector: ".draggable",
draggable: {
stop: function(e, ui, $widget) {
alert('hello world');
}
}
,
draggable: {
handle: ".headertitle"
}
}).data('gridster');
gridster.enable();任何帮助都将不胜感激
发布于 2015-01-08 02:32:10
解决了问题,使用了两次定义变量draggable,取消了stop函数,将它们移到一个设置中,解决了问题
draggable: {
stop: function(e, ui, $widget) {
alert('hello world');
}
}
,
draggable: {
handle: ".headertitle"
}编辑为
draggable: {
handle: ".headertitle"
stop: function(e, ui, $widget) {
alert('hello world');
}
}https://stackoverflow.com/questions/27802526
复制相似问题