jQWidgets jqxGauge LinearGauge easing属性

jQWidgets jqxGauge LinearGauge easing属性

jQWidgets是一个JavaScript框架,用于为PC和移动设备制作基于Web的应用程序。它是一个非常强大的,优化的,独立于平台的,并且被广泛支持的框架。jqxGauge代表一个jQuery仪表部件,它是一个数值范围内的指标。我们可以使用Gauges来显示数据区域内的一个数值范围,有2种类型的Gauges。RadialGauge和LinearGauge。线性仪表(LinearGauge)是一个仪表部件,它可以在水平或垂直方向上表示,它的值是以垂直方式从一些值中线性表示。

easing属性用于设置或返回easing属性,即用于设置或返回jqxLinearGauge的动画缓和。它接受字符串类型的值,其默认值是’linear’。

语法:

  • 它用于设置缓和属性。
$('Selector').jqxLinearGauge({ easing : string});
  • 它用于返回宽松属性。
var easing = $('Selector').jqxLinearGauge('easing');

可能值:

  • linear
  • easeOutBack
  • easeInQuad
  • easeInOutCirc
  • easeInOutSine
  • easeOutCubic

链接的文件:从链接中下载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/jqxchart.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxgauge.js”></script>

例子:下面的例子说明了jQWidgets中jqxLinearGauge的easing属性。

<!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/jqxchart.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxgauge.js">
    </script>
  </head>
  
  <body>
    <center>
      <h1 style="color: green">GeeksforGeeks</h1>
      <h3>jQWidgets jqxLinearGauge easing property</h3>
      <div id="gauge"></div>
      <hr />
      <button id="btn">Animate</button>
    </center>
  
    <script type="text/javascript">
      (document).ready(function () {
        ("#gauge").jqxLinearGauge({
          value: 0,
          animationDuration: 1200,
          easing: "easeOutBack",
        });
      });
      ("#btn").click(function () {
        ("#gauge").jqxLinearGauge({
          value: 30,
        });
      });
    </script>
  </body>
</html>

输出:

jQWidgets jqxGauge LinearGauge easing属性

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程