我使用了一个名为Gridster的jquery插件。
http://gridster.net/
在初始化网格时,我试图为collision.on_overlap_stop设置一个回调,但是每次我设置它时,程序都会在网格代码中抛出各种错误。
有没有其他人遇到过这个问题?
代码示例:
<script type="text/javascript">
var gridster;
$(function(){
gridster = $(".gridster ul").gridster({
widget_margins: [10, 10],
widget_base_dimensions: [140, 140],
draggable: {
stop: function(event, ui)
{
//code...
}
},
collision:
{
//this function doesn't seem to be called and when this function is set the page crashes.
on_overlap_stop: function(collider_data)
{
//code....
}
},
}).data('gridster');
});
</script>发布于 2013-02-15 20:05:21
只是遇到了同样的问题。如果你想使用on_overlap_stop或on_overlap_start,你需要同时提供它们。这样就不会显示错误。
https://stackoverflow.com/questions/12080123
复制相似问题