<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1"/> <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/> <style> #progressholder{ width: 100%; background-color:#ddd; } #progress{ width: 0%; height:30px; background-color:green; } </style> </head> <body> <nav class="navbar navbar-default"> <div class="container-fluid"> </div> </nav> <div class="col-md-6 well"> <hr style="border-top:1px dotted #ccc;"/> <div class="col-md-6"> <div id="result" style="display:none;"> <div id="progressholder"> </div> </div> </div> </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1"/> <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/> <style> #progressholder{ width: 100%; background-color:#ddd; } #progress{ width: 0%; height:30px; background-color:green; } </style> </head> <body> <nav class="navbar navbar-default"> <div class="container-fluid"> </div> </nav> <div class="col-md-6 well"> <hr style="border-top:1px dotted #ccc;"/> <div class="col-md-6"> <div id="result" style="display:none;"> <div id="progressholder"> </div> </div> </div> </div> </body> </html>
function progressBar(){ var progress = document.getElementById('progress'); var width = 0; var interval = setInterval(progressDuration, 60); function progressDuration(){ if(width >= 100){ clearInterval(interval); window.location = 'home.html'; }else{ width++; progress.style.width = width + '%'; } } } function launchProgress(){ document.getElementById('result').style.display="inline"; progressBar(); }