请教一个问题,不知道能否实现,自己感觉都有点变态
我现在有一个CSS文件(一个进度条文件)如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CSS进度条</title>
</meta><style>
.star-rating{
list-style:none;
margin: 0px;
padding:0px;
width: 210px;
height: 30px;
position: relative;
background: url(../../images/star_rating2.gif) top left repeat-x; 
}
.star-rating li{
padding:0px;
margin:0px;
/*\*/
float: left;
/* */
}
.star-rating li a{
display:block;
width:30px;
height: 30px;
text-decoration: none;
text-indent: -9000px;
z-index: 20;
position: absolute;
padding: 0px;
}
.star-rating li a:hover{
background: url(../../images/star_rating2.gif) left center;
z-index: 2;
left: 0px;
}
.star-rating a.one-star{
left: 0px;
}
.star-rating a.one-star:hover{
width:30px;
}
.star-rating a.two-stars{
left:30px;
}
.star-rating a.two-stars:hover{
width: 60px;
}
.star-rating a.three-stars{
left: 60px;
}
.star-rating a.three-stars:hover{
width: 90px;
}
.star-rating a.four-stars{
left: 90px;

.star-rating a.four-stars:hover{
width: 120px;
}
.star-rating a.five-stars{
left: 120px;
}
.star-rating a.five-stars:hover{
width: 150px;
}
.star-rating a.six-stars{
left: 150px;
}
.star-rating a.six-stars:hover{
width: 180px;
}
.star-rating a.seven-stars{
left: 180px;
}
.star-rating a.seven-stars:hover{
width: 210px;
}
.star-rating li.current-rating{
background: url(../../images/star_rating2.gif) left bottom;
position: absolute;
height: 30px;
width:150px;
display: block;
text-indent: -9000px;
z-index: 1;

</style>
</head>
<body> <ul class="star-rating">
<li class="current-rating">Currently 5/5 Stars.</li>
<li><a href="#" title="1 star out of 5" class="one-star">1</a></li>
<li><a href="#" title="2 stars out of 5" class="two-stars">2</a></li>
<li><a href="#" title="3 stars out of 5" class="three-stars">3</a></li>
<li><a href="#" title="4 stars out of 5" class="four-stars">4</a></li>
<li><a href="#" title="5 stars out of 5" class="five-stars">5</a></li>
<li><a href="#" title="6 stars out of 6" class="six-stars">6</a></li>
<li><a href="#" title="7 stars out of 7" class="seven-stars">7</a></li></ul> 
</body>
</html>现在想实现的效果是:
代码中用红标出来的那一段(width:150px)其中数字"150"能否用一个JS的变量能获取
或者其它方法也行,只要能变动就行