We would like to know how to set width to one fifth of the full screen width.
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<script type='text/javascript'>
$(window).load(function(){<!--from ww w . java 2 s.c o m-->
$(document).ready(function() {
var width=(1/5*100);
$('#progress_bar').css('width', width + "%");
});
});
</script>
</head>
<body>
<div id="progress_bar" style="height: 1em; width: 1%; background: red;"></div>
</body>
</html>
The code above is rendered as follows: