I have a preload or progress that I show before being redirected to another page.
What I want is that while it is loading to open another page, the div of the progress is increasing up to 100%, as well as a numerical value (n / 100).
I currently have the following code:
var ajax_load = "<div class='progress'>" + "<div id='progress_id' class='progress-bar progress-bar-striped active' " +
"role='progressbar' aria-valuenow='20' aria-valuemin='0' aria-valuemax='100' style='width: 45%'>" +
"n/100</div></div>";
$("#menu_navegacion_inicio").click(function (ev) {
ev.preventDefault();
var href = $(this).attr('href');
$("#subpagina").html(ajax_load).load(baseUrl + href, function () {
});
});
In ajax_load I call the progress, but I need the value of the attribute aria-valuenow
, go increasing to 100, and n
also increase to 100, where n / 100.
I would like to pass values to it while the page starts loading, indicating the delay time, which starts from 0% to 100%, once the progress load is finished, the page I requested opens.
I was thinking of using some iteration and pass something like this:
........
.....
var valeur= valeur +10;
........
$('#progress_id').css('width', valeur+'%').attr('aria-valuenow', valeur);
$('#progress_id').append(valeur + '/100')
......
......
But I do not know how I do it, if anyone knows I would appreciate it a lot. I do not know if I understand what I said