【问题标题】:Make gridster.js tiles stick in specific grid positions (snap to grid)使 gridster.js 瓷砖贴在特定的网格位置(对齐网格)
【发布时间】:2014-06-24 18:25:12
【问题描述】:

有什么方法可以让 Gridster.js 贴图粘住,而不是垂直向上移动以填充空白空间。有点像打开对齐网格的布局程序的工作方式......

【问题讨论】:

  • 您可以使用GSAP 作为替代。它已经具有对齐网格功能。

标签: javascript jquery gridster


【解决方案1】:

使用这个 fork https://github.com/dsmorse/gridster.js

shift_widgets_up: false

选项。

查看演示:http://dsmorse.github.io/gridster.js/demos/sticky-postion.html

【讨论】:

    【解决方案2】:

    你试过打包吗? http://packery.metafizzy.co/ 这个库有很多拖放功能。

    【讨论】:

      【解决方案3】:

      您可能还对我团队的以下原型感兴趣:https://github.com/ibmjstart/gridplumb

      具体对grister的修改可以在https://github.com/ibmjstart/gridplumb/blob/master/src/extend-gridster.js找到

      【讨论】:

        【解决方案4】:

        我的答案不是直接链接到 gridster,而是链接到它的一个分支:gridstack。当我在 gridstack 中搜索此功能时发现此主题时,我发布了此答案。

        所以在 gridstack 中的解决方案是把这个属性放在网格选项中:

        float:true
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2021-05-02
          • 2015-09-06
          • 2019-03-10
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多