当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


jQWidgets jqxDocking keyboardNavigation属性用法及代码示例


jQWidgets是一个 JavaScript 框架,用于为 PC 和移动设备制作基于 Web 的应用程序。它是一个非常强大、优化、独立于平台且得到广泛支持的框架。这jqx对接用于表示管理多个窗口以及网页布局的小部件。这里指定的 jqxDocking 中的每个窗口都可以执行多项任务,例如可以在网页周围拖动、停靠到停靠区域、从停靠中移除、折叠到最小化状态以隐藏其内容,还可以展开以显示其内容内容。

键盘导航属性用于启用或禁用指定 jqxDocking 的键盘导航。该住宿接受布尔值。

用法:

  • 用于设置键盘导航属性:

    $('#jqxDocking').jqxDocking({
        keyboardNavigation: true
    });  
  • 为了得到键盘导航属性:

    var keyboardNavigation = 
        $('#jqxDocking').jqxDocking('keyboardNavigation');

链接文件:从给定链接下载 https://www.jqwidgets.com/download/。在 HTML 文件中,找到下载文件夹中的脚本文件。

<link rel=”stylesheet” href=”jqwidgets/styles/jqx.base.css” type=”text/css” />
<script type=”text/javascript” src=”scripts/jquery.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxdocking.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxwindow.js”></script>

例子:下面的示例说明了 jQWidgets jqxDocking键盘导航属性。在下面的示例中,值键盘导航属性已设置为 true。

HTML


<!DOCTYPE html> 
<html lang="en"> 
  
<head> 
    <link rel="stylesheet" 
          href="jqwidgets/styles/jqx.base.css"
          type="text/css"/> 
    <script type="text/javascript" 
            src="scripts/jquery.js"> 
    </script> 
    <script type="text/javascript" 
            src="jqwidgets/jqxcore.js"> 
    </script> 
    <script type="text/javascript" 
            src="jqwidgets/jqxdocking.js"> 
    </script> 
    <script type="text/javascript" 
            src="jqwidgets/jqxwindow.js"> 
    </script> 
</head> 
  
<body> 
    <center> 
        <h1 style="color: green;"> 
            GeeksforGeeks 
        </h1> 
        <h3> 
            jQWidgets jqxDocking keyboardNavigation Property 
        </h3> 
        <div id="jqx_Docking" style="margin: 25px;" 
             align="left"> 
            <div> 
                <div id="Window"> 
                    <div>Window</div> 
                    <div> 
                        <h8>Content of the window</h8> 
                        <ul> 
                            <li>GFG</li> 
                            <li>CSE</li> 
                        </ul> 
                    </div> 
                </div> 
            </div> 
        </div> 
        <input type="button" style="margin: 29px;"
               id="jqxbutton_for_keyboardNavigation"
          value="Value of the keyboardNavigation property"/> 
        <div id="log"></div> 
        <script type="text/javascript"> 
            $(document).ready(function () { 
                $("#jqx_Docking").jqxDocking({ 
                    width: 250, 
                    keyboardNavigation: true 
                }); 
                $("#jqxbutton_for_keyboardNavigation"). 
                    jqxButton({ 
                        width: 320 
                    }); 
                $('#jqxbutton_for_keyboardNavigation').on( 
                    'click', function () { 
                        var Value_of_keyboardNavigation = 
                            $('#jqx_Docking').jqxDocking( 
                                'keyboardNavigation'); 
                        $("#log").html(JSON.stringify( 
                            Value_of_keyboardNavigation)); 
                    }); 
            }); 
        </script> 
    </center> 
</body> 
  
</html>

输出:

参考: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxnavigationbar/jquery-navigationbar-api.htm?search=



相关用法


注:本文由纯净天空筛选整理自Kanchan_Ray大神的英文原创作品 jQWidgets jqxDocking keyboardNavigation Property。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。