I try to make progress bar, the css code like this:
#result{
background:#8c8f91;
margin-left: 15px;
margin-right: auto;
table-layout: fixed;
border-collapse: collapse;
z-index: -1; position:relative;
width: 0%;
}
And I want to update my progress bar with Ajax:
$(function worker(){
// don't cache ajax or content won't be fresh
$.ajaxSetup ({
cache: false,
complete: function() {
// Schedule the next request when the current one's complete
setTimeout(worker, 4500);
}});
$("#result").css("width"," <?php echo json_encode($percent); ?>");
$("#result").load("http://localhost/test6/select-oki.php #result").fadeIn();
}
// end
});
I want to update "width" value with "$percent", but it didnt get value from it. I think the problem is in this :
$("#result").css("width"," <?php echo json_encode($percent); ?>");
<? php echo $percent ?>