网上找到的星级评分插件,感觉挺不错的
贴下代
<!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 runat="server"> <title> 星级评分</title> <script src="scripts/jquery-1.4.2.min.js" type="text/javascript"></script> <script src="scripts/jquery.raty.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $("#star").raty({ start: '<%= Score %>', //readOnly: true, path: '/images/', starOn: 'star-on.png', starOff: 'star-off.png', hintList: ['很不满意', '不满意', '一般', '满意', '非常满意'] }); $("#star").width(200); </script> </head> <body> <form id="form1" runat="server"> <div id="star"> </div> <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /> <div> </form> </body> </html>
后台用的是asp.net
public partial class WebForm1 : System.Web.UI.Page { public int Score = 0; protected void Page_Load(object sender, EventArgs e) { Score = 3; } protected void Button1_Click(object sender, EventArgs e) { Score = int.Parse(Request.Form["score"]); Response.Write(Request.Form["score"]); } }