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


jQWidgets jqxResponsivePanel animationDirection屬性用法及代碼示例

jQWidgets 是一個 JavaScript 框架,用於為 PC 和移動設備製作基於 Web 的應用程序。它是一個非常強大、優化、獨立於平台且得到廣泛支持的框架。 jqxResponsivePanel 是一個 jQuery 小部件,用於表示具有響應行為的麵板小部件。響應式麵板用於以響應式方式顯示內容。當瀏覽器窗口的寬度小於設定值時,該麵板會折疊,單擊按鈕後,我們可以訪問該值。

AnimationDirection 屬性用於設置或返回動畫的方向。當“animationType”屬性值設置為‘slide’時使用此屬性。它接受 String 類型值,默認值為“left”。

其可能的值為 -

  • ‘left’
  • ‘right’
  • ‘top’
  • ‘bottom’

用法:

設置animationDirection屬性。

$('selector').jqxResponsivePanel({ 
    animationDirection: String 
});

返回animationDirection屬性。

var animationDirection = $('selector')
    .jqxResponsivePanel('animationDirection');

鏈接文件:從鏈接 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/jqxresponsivepanel.js”></script>

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

例子:

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/jqxresponsivepanel.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 jqxResponsivePanel animationDirection Property
    </h3>
    <div id="GFG" style="width:400px;">
        <div style="border: 1px solid #e1e1e1">
            <div id="TRP"></div>
        </div>
        <div id="jqxRP" style="padding: 5px;">
            <h4>HTML</h4>
             
<p>
                HTML stands for HyperText Markup 
                Language. It is used to design 
                web pages using a markup language. 
                HTML is the combination of Hypertext 
                and Markup language. Hypertext 
                defines the link between the web pages.
            </p>
        </div>
    </div>
    <script type="text/javascript">
        $(document).ready(function() {
            $('#jqxRP').jqxResponsivePanel({
                width: 400,
                height: 250,
                toggleButton: $('#TRP'),
                animationType: 'slide',
                animationDirection: 'top'
            });
        });
    </script>
</body>
</html>

輸出:

參考: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxresponsivepanel/jquery-responsive-panel-api.htm



相關用法


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