當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


jQWidgets jqxListMenu alwaysShowNavigationArrows屬性用法及代碼示例


jQWidgets 是一個 JavaScript 框架,用於為 PC 和移動設備製作基於 Web 的應用程序。它是一個非常強大、優化、獨立於平台且得到廣泛支持的框架。 jqxListMenu 是一個 jQuery 小部件,用於顯示有序列表和無序列表的集合。我們可以使用有序列表和無序列表創建嵌套列表。

alwaysShowNavigationArrows 屬性用於設置或返回是否為所有項目顯示導航箭頭。它接受布爾類型值,默認值為 false。

用法:

  • 設置alwaysShowNavigationArrows 屬性。

    $('selector').jqxListMenu({ 
        alwaysShowNavigationArrows: Boolean 
    });
  • 返回alwaysShowNavigationArrows 屬性。

    var nav = $('selector')
      .jqxListMenu('alwaysShowNavigationArrows');
  • 鏈接文件:從鏈接 https://www.jqwidgets.com/download/下載 jQWidgets。在 HTML 文件中,找到下載文件夾中的腳本文件。

    <link rel=”stylesheet” href=”jqwidgets/styles/jqx.base.css” type=”text/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/jqx-all.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxdata.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxlistmenu.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxpanel.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxscrollbar.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxbuttons.js”></script>

    下麵的示例說明了 jQWidgets 中的 jqxListMenu alwaysShowNavigationArrows 屬性。

    例子:

    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-1.11.1.min.js"> 
        </script> 
        <script type="text/javascript" 
                src="jqwidgets/jqxcore.js"> 
        </script> 
        <script type="text/javascript" 
                src="jqwidgets/jqx-all.js"> 
        </script> 
        <script type="text/javascript" 
                src="jqwidgets/jqxdata.js"> 
        </script> 
        <script type="text/javascript" 
                src="jqwidgets/jqxlistmenu.js"> 
        </script> 
        <script type="text/javascript" 
                src="jqwidgets/jqxpanel.js"> 
        </script> 
        <script type="text/javascript" 
                src="jqwidgets/jqxscrollbar.js"> 
        </script> 
        <script type="text/javascript" 
                src="jqwidgets/jqxbuttons.js"> 
        </script> 
      
        <style> 
            h1, 
            h3 { 
                text-align: center; 
            } 
              
            #GFG { 
                width: 100%; 
                margin: 0 auto; 
            } 
        </style> 
    </head> 
      
    <body> 
        <h1 style="color: green;"> 
            GeeksforGeeks 
        </h1> 
      
        <h3> 
            jQWidgets jqxListMenu  
            alwaysShowNavigationArrows Property 
        </h3> 
      
      
        <div id="GFG" style="width: 300px;"> 
            <ul id="list" data-role="listmenu"> 
                <li>Web Technology 
                    <ul data-role="listmenu"> 
                        <li>Frontend Development 
                            <ul data-role="listmenu"> 
                                <li>HTML</li> 
                                <li>CSS</li> 
                                <li>JavaScript</li> 
                                <li>jQuery</li> 
                            </ul> 
                        </li> 
                        <li>Backend Development 
                            <ul data-role="listmenu"> 
                                <li>PHP</li> 
                                <li>Node.js</li> 
                                <li>Python</li> 
                                <li>Java</li> 
                            </ul> 
                        </li> 
                    </ul> 
                </li> 
                <li>GeeksforGeeks Programming 
                    <ul data-role="listmenu"> 
                        <li>C++</li> 
                        <li>Java</li> 
                        <li>Python</li> 
                    </ul> 
                </li> 
            </ul> 
        </div> 
      
        <script type="text/javascript"> 
            $(document).ready(function () { 
                $('#list').jqxListMenu({ 
                    width: 300, 
                    height: 250, 
                    showHeader: true, 
                    showBackButton: true, 
                    showFilter: false, 
                      alwaysShowNavigationArrows: false 
                }); 
            }); 
        </script> 
    </body> 
      
    </html>

    輸出:

    參考: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxlistmenu/jquery-listmenu-api.htm



相關用法


注:本文由純淨天空篩選整理自ppatelkap大神的英文原創作品 jQWidgets jqxListMenu alwaysShowNavigationArrows Property。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。