布局框架

基于Bootstrap的可拖拽式网格系统插件

阿里云


jquery.gridstrap.js 是一款基于 Bootstrap 的可拖拽式网格系统插件。该插件可以快速生成基于 bootstrap 响应式网格的、可以自由拖拽的网格布局。
使用方法
在 HTML 文件中引入。

  1. <link href="dist/jquery.gridstrap.min.css" rel="stylesheet">
  2. <script src="//code.jquery.com/jquery-3.2.1.js"></script>
  3. <script src="dist/jquery.gridstrap.min.js"></script>
也想出现在这里?联系我们
创客主机

HTML 结构

  1. <div id="grid" class="row">
  2.   <div class="col-xs-4 col-sm-2 col-md-1"></div>
  3.   <div class="col-xs-4 col-sm-2 col-md-1"></div>
  4.   ...
  5. </div>

初始化插件
然后通过下面的代码来初始化插件

  1. $(function(){
  2.   $('#grid').gridstrap({
  3.     /* default options */
  4.   });
  5. });

配置参数

  1. $.Gridstrap.defaultOptions = {
  2.   gridCellSelector: '>*', // jQuery selector for grid's cells relative to parent element.
  3.   hiddenCellClass: 'gridstrap-cell-hidden', // class applied to 'hidden' cells.
  4.   visibleCellClass: 'gridstrap-cell-visible', // class applied to 'visible' cells.
  5.   nonContiguousPlaceholderCellClass: 'gridstack-noncontiguous',  // class applied to non-contiguous placeholder cells.
  6.   dragCellClass: 'gridstrap-cell-drag', // class applied to dragging cell.
  7.   resizeCellClass: 'gridstrap-cell-resize', // class applied to resizing cell.
  8.   mouseMoveSelector: 'body', // jQuery selector to bind mousemouse and mouseup events.
  9.   visibleCellContainerParentSelector: null, // jQuery selector to append 'visible' cell container to. Null will use the element the plugin is initialised on.
  10.   visibleCellContainerClass: 'gridstrap-container', // class applied to the cell container element.
  11.   getHtmlOfSourceCell: function ($cell) { // function to return the html of a 'source' cell.
  12.     return $cell[0].outerHTML;
  13.   },  
  14.   dragCellHandleSelector: '*', // jQuery selector relative to and including cell for drag handling.
  15.   draggable: true, // toggle mouse dragging.
  16.   rearrangeOnDrag: true, // toggle the triggering of rearranging cells before mouseup.
  17.   resizeHandleSelector: null, // jQuery selector relative to cell for resize handling. Null disables.
  18.   resizeOnDrag: true, // toggle mouse resizing. 
  19.   swapMode: false, // toggle swap or insert mode when rearranging cells.
  20.   nonContiguousCellHtml: null, // html to use for non-contiguous placeholder cells.
  21.   autoPadNonContiguousCells: true, // toggle adding non-contiguous cells automatically on drag or as otherwise needed.
  22.   updateCoordinatesOnWindowResize: true, // enable window resize event handler.
  23.   debug: false, // toggle console output.
  24.   dragMouseoverThrottle: 150, // throttle cell mouseover events for rearranging.
  25.   windowResizeDebounce: 50,  // debounce redraw on window resize.
  26.   mousemoveDebounce: 0 // debounce mousemove for dragging cells.
  27. };

Github 网址:https://github.com/rosspi/gridstrap.js

基于 Bootstrap 的可拖拽式网格系统插件

已有 577 人购买
  • uyph
查看演示升级 VIP立刻购买

演示地址 下载地址
收藏
(1)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!