Sarius87
Banned
- Registriert
- Mai 2016
- Beiträge
- 888
moin, ich habe jetzt diesen code der jede Sekunde den wert der get.php als progressbar angibt :
animate.css :
progressbar.css : https://hastebin.com/avuxigohug.css
habe eigentlich die Attribute animated hinzugefügt damit sich der Balken sanft bewegt, doch er bewegt sich immer abrupt , doch wieso ? geht das nicht mit ajax ?
HTML:
<script type="text/javascript" src="https://code.jquery.com/jquery.min.js"></script>
<link rel="stylesheet" href="progressbar.css">
<link rel="stylesheet" href="animate.css">
<div id="inhalt" class="w3-container w3-blue w3-round animated">%</div>
<script language="javascript" type="text/javascript">
$(document).ready(function($){
function loadlink(){
$.ajax({
url: 'get.php',
success: function(data){
document.getElementById("inhalt").style.width=data;
}});
}
loadlink();
setInterval(function(){
loadlink()
}, 1000);
});
</script>
animate.css :
HTML:
.animated {
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.animated.infinite {
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
}
.animated.hinge {
-webkit-animation-duration: 2s;
animation-duration: 2s;
}
progressbar.css : https://hastebin.com/avuxigohug.css
habe eigentlich die Attribute animated hinzugefügt damit sich der Balken sanft bewegt, doch er bewegt sich immer abrupt , doch wieso ? geht das nicht mit ajax ?