PS:Jquery實現星星評價!!!javascript
Jquery代碼:css
<script type="text/javascript">java
$(document).ready(function(){ide
$(".jsstar >li").hover(this
function(){$(this).css({"background-position":"left bottom"}).prev().trigger("mouseover")},url
function(){$(this).css({"background-position":"left top"}).prev().trigger("mouseout")})spa
.click(function(){alert($(this).attr("title"))}); seo
});ip
</script>it
HTML代碼:
<body>
<div class="block">
<p>Javascript + CSS實現</p>
<ul class="jsstar">
<li title="一星"></li>
<li title="二星"></li>
<li title="三星"></li>
<li title="四星"></li>
<li title="五星"></li>
</ul>
</div>
</body>