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


jQWidgets jqxNavigationBar rtl屬性用法及代碼示例


jQWidgets是一個 JavaScript 框架,用於為 PC 和移動設備製作基於 Web 的應用程序。它是一個非常強大、優化、獨立於平台且得到廣泛支持的框架。這 jqxNavigationBar用於表示具有標題和內容部分的 jQuery 小部件。單擊標題時,內容將相應地展開或折疊。

回程 屬性用於檢查指定的 jqxNavigationBar 是否啟用從右到左的支持。此屬性接受兩個值:‘true’ 和‘false’。

用法:

  • 用於設置回程屬性:

    $("Selector").jqxNavigationBar({ rtl: false });  
  • 為了得到回程屬性:

    var rtl = $('Selector').jqxNavigationBar('rtl');

鏈接文件:下載jQWidgets從給定的鏈接。在 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/jqxexpander.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxnavigationbar.js”></script>

例子:下麵的示例說明了 jQWidgets jqxNavigationBar右方屬性。在下麵的示例中,值回程屬性已設置為 false。

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/jqxexpander.js"> 
    </script> 
    <script type="text/javascript" 
            src="jqwidgets/jqxnavigationbar.js"> 
    </script> 
</head> 
  
<body> 
    <center> 
        <h1 style="color: green;"> 
            GeeksforGeeks 
        </h1> 
        <h3> 
            jQWidgets jqxNavigationBar rtl Property 
        </h3> 
        <div id="jqx_Navigation_Bar" 
             style="margin: 25px;" 
             align="left"> 
            <div>First Header</div> 
            <div> 
                <h8>Content for the first header</h8> 
                <ul> 
                    <li>GFG</li> 
                    <li>CSE</li> 
                </ul> 
            </div> 
            <div> Second Header</div> 
            <div> 
                <h8>Content for the second header</h8> 
                <ul> 
                    <li>GeeksforGeeks</li> 
                    <li>CSE</li> 
                </ul> 
            </div> 
        </div> 
        <input type="button" style="margin: 29px;" 
               id="jqxbutton_for_rtl" 
               value="Value of the rtl property"/> 
        <div id="log"></div> 
        <script type="text/javascript"> 
            $(document).ready(function () { 
                $("#jqx_Navigation_Bar"). 
                    jqxNavigationBar({ 
                        width: 290, 
                        height: 132, 
                        rtl: false 
                    }); 
                $("#jqxbutton_for_rtl"). 
                    jqxButton({ 
                        width: 250, 
                    }); 
                $('#jqxbutton_for_rtl'). 
                    on('click', function () { 
                        var value_of_rtl = 
                            $('#jqx_Navigation_Bar'). 
                                jqxNavigationBar( 
                                    'rtl'); 
                        $("#log").html(JSON.stringify( 
                            value_of_rtl)) 
                    }); 
            }); 
        </script> 
    </center> 
</body> 
  
</html>

輸出:

參考: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxnavigationbar/jquery-navigationbar-api.htm



相關用法


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