program to show a progress bar



program to show a progress bar..

Answer / Richa Sharma

To create a simple progress bar, you can use HTML and CSS along with JavaScript's `requestAnimationFrame` function. Here's an example:nn```htmln<!DOCTYPE html>n<html lang='en'>...n<style>n/* ... */n#progress {n width: 100%;n height: 25px;n border-radius: 4px;n background-color: #ccc;n box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);n}n#progress::after {n content: '';n position: absolute;n left: 0;n top: 0;n height: 100%;n width: 0;n background-color: #f44336;n transition: width .5s ease;}n</style>n<body>n <div id='progress'></div>n <script>n // ...n function updateProgress(percent) {n const progressBar = document.getElementById('progress');n progressBar.style.width = `${percent}%`;n }n function animateProgress() {n requestAnimationFrame(animateProgress);n updateProgress(Math.min( Math.random() * 100, 95 ));n }n animateProgress();n</script>n</body>n</html>

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Code Interview Questions

validation code / function to allow only NUmbers in a text box

3 Answers   GE,


Code for Adding Message and Confirmation Boxes Using JavaScript?

1 Answers  


how to Auto Scroll the page

1 Answers   Ninestars,


write a program segment that will ask the user if he wants to computer the perimeter of the area of the triangle. if the perimeter is wanted, ask the measure of the three sides and compute for the perimeter. if the area is wanted, ask for the measures of the base and height and compute for the area. display the computed value

1 Answers  


Reading which Character Key was pressed

1 Answers  


maximizing the main window

1 Answers  


<html> <head> <title>BASIC CALCULATOR</title> </head> <script language= "javascript"> function= setValue(){ var a_term1 </script> <body> <center> <table> <tr> <td><input type="text" id="text box1" style="width:50px"> </td> <td><input type="text" id="text box2" style="width:40px"> </td> <td><input type="text" id="text box3" style="width:50px"> </td> </tr> </table> <table> <tr> <td><input type="text" id="text box4" ></td> </tr> </table> <table> <tr> <td><input type= "button" value= "7" onClick="" ></td> <td><input type= "button" value= "8" onClick="" ></td> <td><input type= "button" value= "9" onClick="" ></td> <td><input type= "button" value= "/" onClick="" ></td> </tr> <td><input type= "button" value= "4" onClick="" ></td> <td><input type= "button" value= "5" onClick="" ></td> <td><input type= "button" value= "6" onClick="" ></td> <td><input type= "button" value= "*" onClick="" ></td> </tr> <td><input type= "button" value= "1" onClick="" ></td> <td><input type= "button" value= "2" onClick="" ></td> <td><input type= "button" value= "3" onClick="" ></td> <td><input type= "button" value= "-" onClick="" ></td> </tr> <td><input type= "button" value= "0" onClick="" ></td> <td><input type= "button" value= "C" onClick="" ></td> <td><input type= "button" value= "=" onClick="" ></td> <td><input type= "button" value= "+" OnClick="" ></td> </table> </center> </body> <hr/> </html> how do i make the calculator work now

1 Answers  


How to encode and decode URL strings?

1 Answers   TCS,


how to copy form data between different pages

1 Answers  


function to combine two or more arrays

1 Answers   Aricent,


how to create Expandable and Collapsible Menus

1 Answers  


code to keep a page Out of the browser history

1 Answers  


Categories
  • PHP Code Interview Questions PHP Code (33)
  • JSP Code Interview Questions JSP Code (6)
  • ASP Code Interview Questions ASP Code (5)
  • CGI Perl Code Interview Questions CGI Perl Code (3)
  • JavaScript Code Interview Questions JavaScript Code (63)
  • VB Script Code Interview Questions VB Script Code (20)
  • Shell Script Code Interview Questions Shell Script Code (31)
  • Python Code Interview Questions Python Code (34)
  • WinRunner Code Interview Questions WinRunner Code (1)
  • HTML DHTML XHTML Code Interview Questions HTML DHTML XHTML Code (13)
  • XML Interview Questions XML (43)
  • Scripts_Markup Code AllOther Interview Questions Scripts_Markup Code AllOther (5)