Site Notice
hello, world
Difference between revisions of "Progress"
From Project-EPB Commons
([InPageEdit] 没有编辑摘要) |
([InPageEdit] 没有编辑摘要) |
||
Line 1: | Line 1: | ||
<html> | <html> | ||
− | <progress id="progress" value="0" max=" | + | <progress id="progress" value="0" max="100" style="width: 80%; margin: auto 10%"/> |
<script> | <script> | ||
var goprogess = setInterval(function () { | var goprogess = setInterval(function () { | ||
Line 6: | Line 6: | ||
if (typeof x === 'undefined') x = 0; | if (typeof x === 'undefined') x = 0; | ||
if (x < 500) { | if (x < 500) { | ||
− | x = x + | + | x = x + 10; |
} else if (x < 800) { | } else if (x < 800) { | ||
− | x = x + | + | x = x + 5; |
} else if (x < 900) { | } else if (x < 900) { | ||
− | x = x + | + | x = x + 3; |
} else { | } else { | ||
− | x = x + | + | x = x + 1; |
} | } | ||
if (x > 985) clearInterval(goprogess); | if (x > 985) clearInterval(goprogess); | ||
$('#progress').val(x); | $('#progress').val(x); | ||
} | } | ||
− | }, | + | }, 20); |
</script> | </script> | ||
</html> | </html> |
Revision as of 18:51, 21 November 2019
<html> <progress id="progress" value="0" max="100" style="width: 80%; margin: auto 10%"/> <script> var goprogess = setInterval(function () {
if (typeof($) !== 'undefined') { if (typeof x === 'undefined') x = 0; if (x < 500) { x = x + 10; } else if (x < 800) { x = x + 5; } else if (x < 900) { x = x + 3; } else { x = x + 1; } if (x > 985) clearInterval(goprogess); $('#progress').val(x); }
}, 20); </script> </html>