Basics

优质
小牛编辑
126浏览
2023-12-01

描述 (Description)

进度条包含两个元素容器, .progress和一个米, .progress-meter 。 进度条的状态由rolearia-属性简化。

以下列表阐明了属性的用途 -

  • aria-valuemin - 它表示进度条的最小值。

  • aria-valuemax - 表示进度条的最大值。

  • aria-valuenow - 它表示进度条的当前值。

  • aria-valuetext - 如果进度条的值不是数字,则添加此属性,该属性必须包含进度条值的人类可读版本。

要填充进度条,您必须将width CSS属性添加到内部仪表。

例子 (Example)

以下示例演示如何在Foundation中使用progress bar

<html>
   <head>
      <title>Progress Bar</title>
      <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/css/foundation.css">
   </head>
   <body>
      <h2>Progress Bar</h2>
      <div class = "progress" role = "progressbar" tabindex = "0" aria-valuenow = "0" aria-valuemin = "0" aria-valuemax = "100">
         <div class = "progress-meter"></div>
      </div>
      <div class = "progress" role = "progressbar" tabindex = "0" aria-valuenow = "80" aria-valuemin = "0" aria-valuetext = "80 percent" aria-valuemax = "100">
         <div class = "progress-meter" style = "width: 80%"></div>
      </div>
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/vendor/jquery.min.js"></script>
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/foundation.min.js"></script>
      <script>
         $(document).ready(function() {
            $(document).foundation();
         })
      </script>
   </body>
</html>