Jquery rating)

Source: Internet
Author: User

 

Plug-in parameters:

  • The first parameter of rater is the URL submitted by Ajax.
  • Second parameter of rater
  • Maxvalue: Maximum number of stars
  • Curvalue: the number of stars selected by default.
  • Title: The prompt that the mouse is placed on the star
  • Enable: You can set true or false to check whether the control is available.
  • The third callback function of rater.
ASPX page code:
<% @ Page Language = "C #" autoeventwireup = "true" codefile = "default. aspx. cs" inherits = "_ default" %>

<! 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> porschev ---- jquery rating demo </title>
<Link href = "CSS/jquery.rater.css" rel = "stylesheet" type = "text/CSS"/>

<SCRIPT src = "jquery/jquery-1.3.2-vsdoc.js" type = "text/JavaScript"> </SCRIPT>

<SCRIPT src = "jquery/jquery. rater. js" type = "text/JavaScript"> </SCRIPT>

<SCRIPT type = "text/JavaScript">
$ (Function (){
$ ('# Example1 '). rater ("handler. ashx ", {maxvalue: 5, curvalue: 2.5, Title: {1: 'One start', 2: 'Two Stars', 3: 'Three Stars', 4: 'Four Stars', 5: 'five stars'}, function (El, value, Res ){
Alert (RES );
});
})


</SCRIPT>

</Head>
<Body>
<Form ID = "form1" runat = "server">
<Center>
Select level star at the front end:
<Div id = "example1">

</Div>
<Br/>
Background output star:
<Div>
<% = STR %>
</Div>

</Center>
</Form>
</Body>
</Html>
. CS code
Using system;
Using system. Collections. Generic;
Using system. LINQ;
Using system. Web;
Using system. Web. UI;
Using system. Web. UI. webcontrols;
Using system. text;

Public partial class _ default: system. Web. UI. Page
{
Public String STR = string. empty;

Protected void page_load (Object sender, eventargs E)
{
Stringbuilder sb = new stringbuilder ();

SB. append ("<ul style = \" width: 125px; \ "class = \" rating \ "> ");
SB. append ("<li style = \" width :");
SB. append (25*3.6); // The front is the wide prime of a star, followed by the number of stars.
SB. append ("PX; display: List-item; \" class = \ "Current \"> </LI> ");
SB. append ("<li style = \" width: 25px; Z-index: 5; \ "class = \" star \ "> </LI> ");
SB. append ("<li style = \" width: 50px; Z-index: 4; \ "class = \" star \ "> </LI> ");
SB. append ("<li style = \" width: 75px; Z-index: 3; \ "class = \" star \ "> </LI> ");
SB. append ("<li style = \" width: 100px; Z-index: 2; \ "class = \" star \ "> </LI> ");
SB. append ("<li style = \" width: 125px; Z-index: 1; \ "class = \" star \ "> </LI> ");
SB. append ("</ul> ");
STR = sb. tostring ();

}
}
 

Example:

 

Example download 1: http://download.csdn.net/source/2841331

2. http://files.cnblogs.com/zhongweiv/JqueryRatingDemo.rar

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.