Search code examples
javascriptjqueryhtmlgridster

making gridster margins collapse


I'm using gridster to create dynamic grids with 5 pixel margin space between widgets.
but it creates 10 pixel margins! (see this)
actually it adds margin for both neighbor widgets (left & right widgets)
How can i make gridster to collapse margins so the gap between two neighbor widgets be 5 pixel?

Thanks


Solution

  • http://jsfiddle.net/fresheyeball/d6BWD/

      gridster = $(".gridster > ul").gridster({
          widget_margins: [2.5, 2.5],
          widget_base_dimensions: [100, 100]
      }).data('gridster');
    

    5 + 5 = 10

    2.5 + 2.5 = 5