Progress bar / Rating
by vvv vvvv
HTML
<p class="rate-title">Rate this article:</p>
<ul class="rate">
<li>Not at all helpful</li>
<li>Not very helpful</li>
<li>Somewhat helpful</li>
<li>Very helpful</li>
<li>Extremely helpful</li>
</ul>
<p>by Didier De Vos</p>
CSS
body {
padding: 20px;
font: 14px/1.5 sans-serif; /* Pixels? Yep, it's just a little demo. */
color: #333;
}
.rate {
margin-bottom: 1.3em;
padding: 0;
list-style: none;
}
.rate > li {
display: table-cell;
border-bottom: 5px solid rgb(233, 233, 233);;
padding: 1em 1.5em;
width: 5em;
line-height: 1.3;
text-align: center;
cursor: pointer;
-webkit-transition: border 0.2s ease-out;
-moz-transition: border 0.2s ease-out;
-o-transition: border 0.2s ease-out;
transition: border 0.2s ease-out;
/* http://css3please.com/ */
}
.rate:hover li {
border-color: rgb(43, 180, 43);
-webkit-transition: border 0.7s ease-out;
-moz-transition: border 0.7s ease-out;
-o-transition: border 0.7s ease-out;
transition: border 0.7s ease-out;
/* http://css3please.com/ */
}
.rate > li:hover { border-color: rgb(43, 180, 43); }
.rate > li:hover ~ li { border-color: rgb(233, 233, 233); }
.rate-title { font-weight: bold; }
JavaScript
// Hover over any label and a progress bar-like takes shape
// It's like saying 'helpful' = 100% of satisfaction and 'not at all helful' = 0% of satisfaction
// Improved from: http://support.google.com/plus/bin/answer.py?hl=en&answer=1302427
//
// Didier De Vos