javascript - How Do These Callbacks Fit Into A Configuration Object? -
i loving gridster.js, can't figure out how use callbacks. documentation states following can passed gridster configuration object:
draggable.stop: function(event, ui){} // callback when dragging stops. here i'm trying error uncaught syntaxerror: unexpected token . on draggable.stop line.
var gridster = $(".gridster ul").gridster({ widget_margins: [5, 5], widget_base_dimensions: [90, 90], draggable.stop: function(){console.log("drag completed")} }).data('gridster'); what correct syntax use here?
it seems mean draggable option provide needs object literal, , specify stop property callback. like:
var gridster = $(".gridster ul").gridster({ widget_margins: [5, 5], widget_base_dimensions: [90, 90], draggable: { stop: function () { console.log("drag completed"); } } }).data("gridster"); seems confirmed here: https://github.com/ducksboard/gridster.js/issues/18
Comments
Post a Comment