Bootstrap

jquery 插件 rater 星星评论

效果图如下:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="jquery rating.aspx.cs" Inherits="WebSite.jquery_rating" %> <!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>jquery 插件 rater 星星评论</title> <mce:script type="text/javascript" src="jquery/jquery-1.4.4.min.js" mce_src="jquery/jquery-1.4.4.min.js"></mce:script> <link href="jquery/jquery.rater.css" mce_href="jquery/jquery.rater.css" rel="stylesheet" type="text/css" /> <mce:script type="text/javascript" src="jquery/jquery.rater.js" mce_src="jquery/jquery.rater.js"></mce:script> <mce:script type="text/javascript"><!-- //请求的url:jquery rating.aspx //最大数量:maxvalue //默认显示数量:curvalue //title:每个星星的Title信息 //function回调函数 $(function() { $("#starinfo").rater('jquery rating.aspx',{maxvalue:5,curvalue:2,title:{1:'很差',2:'差',3:'一般',4:'好',5:'很好'}},function(el,value,res) { alert(res); } ) } ) // --></mce:script> </head> <body> <form id="form1" runat="server"> <div id="starinfo"> </div> </form> </body> </html>

public string info = string.Empty; protected void Page_Load(object sender, EventArgs e) { if (Request["value"] != null) { info = "你选择了" + Request["value"].ToString() + "颗星星"; Response.Write(info); Response.End(); } }

;