ducksboard / gridster.js

gridster.js is a jQuery plugin that makes building intuitive draggable layouts from elements spanning multiple columns
http://gridster.net/
MIT License
6.04k stars 1.2k forks source link

How to solve the issues when i change the widgets basic size? #496

Open AndrewSteam opened 9 years ago

AndrewSteam commented 9 years ago

I'd like to have square widgets. I changed the css code for the widgets like this:

[data-col="3"] { left:330px;} [data-col="2"] { left:170px;} [data-col="1"] { left:10px;}... [data-row="3"] { top:330px;} [data-row="2"] { top:170px;} [data-row="1"] { top:10px;} ... [data-sizey="1"] { height:140px;} [data-sizey="2"] { height:300px;} [data-sizey="3"] { height:460px;}... [data-sizex="1"] { width:140px;} [data-sizex="2"] { width:300px;} [data-sizex="3"] { width:460px;} ...

Now i can create squares, not only rectangles, but when i try to move a widget, it goes wrong. The moving seems to be fixed as i changed the margin to: 30,30, but the resizing is not good. The faux is jumping, when i try to resize a widget. Where should i search the solution in the code? Thanks for helping!

bondt commented 9 years ago

If you'd like to create square widgets, I'd suggest you use widget_base_dimensions for that, rather than changing the CSS.