jQWidgets 是一个 JavaScript 框架,用于为 PC 和移动设备制作基于 Web 的应用程序。它是一个非常强大且优化的框架,独立于平台,并且得到广泛支持。 jqxSortable 代表一个 jQuery 插件,允许您使用鼠标对 HTML list 或 div 标签中的元素重新排序。
网格属性用于显示网格中每个 x 和 y 像素的排序元素。它根据网格宽度将内容放置在 x 和 y 方向的网格系统中。它是数组类型,默认值为‘错误的'。
用法:
- 它用于设置网格属性:
 
$('Selector').jqxSortable({ "grid", [ 50, 50 ] });
- 它用于返回网格属性:
 
var grid = $('Selector').jqxSortable('grid')
链接文件:下载jQWidgets从给定的链接。在 HTML 文件中,找到下载文件夹中的脚本文件。
<link type=”text/css” rel=”Stylesheet” href=”jqwidgets/styles/jqx.base.css” />
<script type=”text/javascript” src=”scripts/jquery-1.11.1.min.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”jqwidgets/globalization/gloōbalize.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxsortable.js”></script>
例子:下面的例子说明了jqxSortable grid 属性在 jQWidgets 中。
HTML
<!DOCTYPE html> 
<html lang="en"> 
  
<head> 
    <link type="text/css" rel="stylesheet" href= 
        "jqwidgets/styles/jqx.base.css" /> 
    <script type="text/javascript" src= 
        "scripts/jquery-1.11.1.min.js"> 
    </script> 
    <script type="text/javascript" src= 
        "jqwidgets/jqxcore.js"> 
    </script> 
    <script type="text/javascript" src= 
        "jqwidgets/globalization/globalize.js"> 
    </script> 
    <script type="text/javascript" src= 
        "jqwidgets/jqxsortable.js"> 
    </script> 
  
    <style> 
        .heading { 
            text-align: center; 
        } 
        h1 { 
            color: green; 
        } 
  
        #divID { 
            list-style-type: none; 
            margin: auto; 
            width: 237px; 
            height: 237px; 
            border: 1px solid #e1e1e1; 
        } 
  
        #divID div { 
            border: 1px solid #e1e1e1; 
            margin: 1px; 
            float: left; 
            text-align: center; 
            font-size: 60px; 
            color: #292828; 
            width: 75px; 
            height: 75px; 
        } 
    </style> 
</head> 
  
<body> 
    <div class="heading"> 
        <h1>GeeksforGeeks</h1> 
        <h3> 
            jQWidgets jqxSortable grid property 
        </h3> 
    </div> 
    <div id="divID"> 
        <div>A</div> 
        <div>2</div> 
        <div>C</div> 
        <div>4</div> 
        <div>E</div> 
        <div>6</div> 
        <div>G</div> 
        <div>8</div> 
    </div> 
    <script type="text/javascript"> 
        $(document).ready(function () { 
            $("#divID").jqxSortable(); 
            $("#divID").jqxSortable("grid", [50, 50]); 
        }); 
    </script> 
</body> 
</html>输出:

相关用法
- jQWidgets jqxSortable handle属性用法及代码示例
 - jQWidgets jqxSortable containment属性用法及代码示例
 - jQWidgets jqxSortable cancel属性用法及代码示例
 - jQWidgets jqxSortable items属性用法及代码示例
 - jQWidgets jqxSortable forceHelperSize属性用法及代码示例
 - jQWidgets jqxSortable zIndex属性用法及代码示例
 - jQWidgets jqxSortable placeholderShow属性用法及代码示例
 - jQWidgets jqxSortable tolerance属性用法及代码示例
 - jQWidgets jqxSortable dropOnEmpty属性用法及代码示例
 - jQWidgets jqxSortable axis属性用法及代码示例
 - jQWidgets jqxSortable opacity属性用法及代码示例
 - jQWidgets jqxSortable cursorAt属性用法及代码示例
 - jQWidgets jqxSortable connectWith属性用法及代码示例
 - jQWidgets jqxSortable cursor属性用法及代码示例
 - jQWidgets jqxSortable appendTo属性用法及代码示例
 - jQWidgets jqxSortable helper属性用法及代码示例
 - jQWidgets jqxSortable forcePlaceholderSize属性用法及代码示例
 - jQWidgets jqxSortable distance属性用法及代码示例
 - jQWidgets jqxSortable disabled属性用法及代码示例
 - jQWidgets jqxSortable scrollSpeed属性用法及代码示例
 - jQWidgets jqxSortable disable()用法及代码示例
 - jQWidgets jqxSortable scrollSensitivity属性用法及代码示例
 - jQWidgets jqxSortable delay属性用法及代码示例
 - jQWidgets jqxSortable scroll属性用法及代码示例
 - jQWidgets jqxScheduler openMenu()用法及代码示例
 
注:本文由纯净天空筛选整理自vkash8574大神的英文原创作品 jQWidgets jqxSortable grid Property。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
