jQuery星级评测效果代码jQuery实现星级评测效果代码,喜欢的朋友可以测试下。[code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="//www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <script src="images/jQuery-latest.js"></script> <script type="text/javascript"> $(function(){ $("ul li").each(function(i){ $(this).click(function(){ $("li").removeClass("back"); $("li:gt("+i+")").addClass("back"); }) }) }); </script> <style type="text/css"> .front { background:url(images/star_03.jpg); } .back { background:url(images/star_hover.jpg); } ul { list-style:none; width:300px; } ul li { display:block; float:left; border:1px solid #ccc; width:31px; height:30px; background:url(images/star_03.jpg); margin:0px 5px 0px; } </style> </head> <body> <ul> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> </body> </html> [/code]

展开内容