Bootstrap progress bar

im trying to figure out what is wrong with my progress par
(its suppossed to get to 100% after 3 seconds, then redirect, heres my javascript

<script type='text/javascript'>//<![CDATA[
window.onload=function(){

var $progress = $('.progress');

var $progressBar = $('.progress-bar');

    setTimeout(function() {
        $progressBar.css('width', '30%');
        setTimeout(function() {
            $progressBar.css('width', '100%');
            location.href = "index.php"
        }, 2000); // WAIT 2 seconds
    }, 1000);  
}//]]> 
</script>

the result
http://php_class.teamluke.net/Final/logout.php

It seems to be working all right. Where is the problem in the execution. I see it moving to 30% then wait for 2 secs and then move to 90% and then 100%.

I mustv’e screwed up then cause what I the bar (I made it animated)
What im seeing is the bar goes to 30% after a sec, then starts to move, but the redirect happens before the bar is at 100%, why doesn’t the redirect happen once the bar reaches 100%

<script type='text/javascript'>//<![CDATA[
window.onload=function(){

var $progress = $('.progress');

var $progressBar = $('.progress-bar');

    setTimeout(function() {
        $progressBar.css('width', '30%');
        setTimeout(function() {
            $progressBar.css('width', '100%');
            location.href = "index.php"
        }, 2000); // WAIT 2 seconds
    }, 1000);  
}//]]> 
</script>

Shouldn’t it?

I believe this is incorrect.

I think what is happening is that it goes to 100% and then promptly redirects so soon after that you can not see that it went to 100%

thanks… (again)

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.