A gridster configuration object.
Define which elements are the widgets. Can be a CSS Selector string or a jQuery collection of HTMLElements.
Horizontal and vertical margins respectively for widgets.
Base widget dimensions in pixels. The first index is the width, the second is the height.
Add more rows to the grid in addition to those that have been calculated.
Add more rows to the grid in addition to those that have been calculated.
min_cols: 1
The minimum number columns to create.
min_rows: 15
The minimum number of rows to create.
max_size_x: 6
The maximum number of columns that a widget can span.
max_size_y: 6
The maximum number of rows that a widget can span.
autogenerate_stylesheet: true
If true, all the CSS required to position all widgets in their respective columns and rows will be generated automatically and injected to the <head> of the document. You can set this to false and write your own CSS targeting rows and cols via data-attributes like so: [data-col="1"] { left: 10px; }.
Don't allow widgets loaded from the DOM to overlap. This is helpful if you're loading widget positions form the database and they might be inconsistent.
serialize_params: function($w, wgd) { return { col: wgd.col, row: wgd.row } }
A function to return serialized data for each each widget, used when calling the serialize method. Two arguments are passed: $w: the jQuery wrapped HTMLElement, and wgd: the grid coords object with keys col, row, size_x and size_y.
draggable.start: function(event, ui){}
A callback for when dragging starts.
draggable.drag: function(event, ui){}
A callback for when the mouse is moved during the dragging.
draggable.stop: function(event, ui){}
A callback for when dragging stops.
collision.on_overlap_start: function(collider_data) { }
A callback for the first time when a widget enters a new grid cell.
collision.on_overlap: function(collider_data) { }
A callback for each time a widget moves inside a grid cell.
collision.on_overlap_stop: function(collider_data) { }
A callback for the first time when a widget leaves its old grid cell.