最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - HTML drag and drop dashboard with resizable elements - Stack Overflow

programmeradmin1浏览0评论

I'm trying to develop a control where one must be able to add elements, move and resize them. The idea is to draw small diagrams by dragging some elements to the dashboard. Here is what I'm trying to acplish:

  • The dashboard must have fixed boundaries (left/right/bottom/top). Elements should collide with them and not go beyond.

  • Elements can be added with a button or dragged from a repository

  • Elements must be resizable

  • Elements should collide

  • Elements must be movable - freestyle, NOT adjust at the top like gridster or gridstack. I need to be able to put an element at the bottom or at the middle of the dashboard and have empty spaces.

  • I must be able to get all the necessary data from the elements in order to store and recreate the dashboard (save & load).

I started by creating this small test project using the drag & drop features, but soon got the feeling I was trying to reinvent the wheel and maybe doing it in an unnecssary old fashioned way.

But after a few searches, I still didn't find one plugin/control that behaves the way I need or is easy enough for me to change.

Gridster and gridstack make the elements go at the top. TinyDraggable looks nice, but is not resizable. I did try to make the div elements .resizable() (adding the jQueryUI) but I wasn't able to make it work. This plugin does not have (I think) collisions, which would be OK if I managed to get everything else needed. I do like the freedom of movement of the draggable items pared to my tiny project where they go from slot to slot.

So, the question is: do you know if there is any suitable plugin (jQuery) for me? Ready to use or easy to configure/change?

Many thanks

I'm trying to develop a control where one must be able to add elements, move and resize them. The idea is to draw small diagrams by dragging some elements to the dashboard. Here is what I'm trying to acplish:

  • The dashboard must have fixed boundaries (left/right/bottom/top). Elements should collide with them and not go beyond.

  • Elements can be added with a button or dragged from a repository

  • Elements must be resizable

  • Elements should collide

  • Elements must be movable - freestyle, NOT adjust at the top like gridster or gridstack. I need to be able to put an element at the bottom or at the middle of the dashboard and have empty spaces.

  • I must be able to get all the necessary data from the elements in order to store and recreate the dashboard (save & load).

I started by creating this small test project using the drag & drop features, but soon got the feeling I was trying to reinvent the wheel and maybe doing it in an unnecssary old fashioned way.

But after a few searches, I still didn't find one plugin/control that behaves the way I need or is easy enough for me to change.

Gridster and gridstack make the elements go at the top. TinyDraggable looks nice, but is not resizable. I did try to make the div elements .resizable() (adding the jQueryUI) but I wasn't able to make it work. This plugin does not have (I think) collisions, which would be OK if I managed to get everything else needed. I do like the freedom of movement of the draggable items pared to my tiny project where they go from slot to slot.

So, the question is: do you know if there is any suitable plugin (jQuery) for me? Ready to use or easy to configure/change?

Many thanks

Share Improve this question asked Nov 26, 2014 at 0:21 ca2s7lca2s7l 2731 gold badge6 silver badges12 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

Try https://github./troolee/gridstack.js with float mode. In this mode widgets do not go to the top of container.

The library is in active developing. So I can implement missing reasonable features.

发布评论

评论列表(0)

  1. 暂无评论