Make gridster.js tiles stick in specific grid positions (snap to grid)

时光毁灭记忆、已成空白 提交于 2019-12-21 07:12:15

问题


is there any way to make Gridster.js tile(s) stick, that is not move up vertically to fill empty space. Kind of like the way a layout program with snap-to-grid turned on works...


回答1:


Use this fork https://github.com/dsmorse/gridster.js with

shift_widgets_up: false

option.

See demo : http://dsmorse.github.io/gridster.js/demos/sticky-postion.html




回答2:


Have you tried packery? http://packery.metafizzy.co/ This library has many drag and drop features.




回答3:


You may also be interested in the following prototype from my team: https://github.com/ibmjstart/gridplumb

Specifically, the modifications to grister can be found at https://github.com/ibmjstart/gridplumb/blob/master/src/extend-gridster.js




回答4:


My answer is not directly linked to gridster but to one of its fork : gridstack. I post this answer as I found this topic while searching for this functionality in gridstack.

So in gridstack solution is to put this property in grid options :

float:true


来源:https://stackoverflow.com/questions/24393704/make-gridster-js-tiles-stick-in-specific-grid-positions-snap-to-grid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!