Search results

Animation in JavaScript (ES5) ProgressBar control

08 May 2023 / 1 minute to read

Progress Bar support to animate the progress by using animation property. Enable the animation by setting enable property and also you can control the speed by using duration property.

Source
Preview
index.js
index.html
Copied to clipboard
var linearProgress1 = new ej.progressbar.ProgressBar({
  type: 'Linear',
        trackThickness: 24,
        progressThickness: 24,
        value: 100,
        showProgressValue: true,
        animation: {
            enable: true,
            duration: 2000,
            delay: 0
        }
  });
  linearProgress1.appendTo('#percentage');
Copied to clipboard
<!DOCTYPE html><html lang="en"><head>
            
    <title>Essential JS 2 Toast</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Typescript Toolbar Controls">
    <meta name="author" content="Syncfusion">
    <link href="index.css" rel="stylesheet">
    <link href="//cdn.syncfusion.com/ej2/21.2.3/material.css" rel="stylesheet">
    
    
<script src="https://cdn.syncfusion.com/ej2/21.2.3/dist/ej2.min.js" type="text/javascript"></script>
</head>

<body>
    
    <div id="container">
        <div class="row linear-parent">
            <div id="percentage"></div>     
       </div>
    </div>


<script>
var ele = document.getElementById('container');
if(ele) {
    ele.style.visibility = "visible";
 }   
        </script>
<script src="index.js" type="text/javascript"></script>
</body></html>