Jquery plug-in star-rating.js to achieve star rating effect, jquery star rating plug-in

Source: Internet
Author: User

Jquery plug-in star-rating.js to achieve star rating effect, jquery star rating plug-in

Special effects

Jquery star rating plug-in star-rating.js download plug-in, click the stars or the left of the heart, is half, the right is 1 point. Click the minus sign and set the score to 0. Not compatible with browsers earlier than Internet Explorer 8.

Demo Diagram

Usage

Step 1: Introduce the following code:

Copy codeThe Code is as follows:
<Link href = "http://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel = "stylesheet">
<Script src = "http://libs.baidu.com/jquery/1.10.2/jquery.min.js"> </script>
<Link href = "css/star-rating.css" media = "all" rel = "stylesheet" type = "text/css"/>
<Script src = "js/star-rating.js" type = "text/javascript"> </script>

Step 2. Introduce the corresponding input box for the desired effect:

Copy codeThe Code is as follows:
<Input id = "input-2b" type = "number" class = "rating" min = "0" max = "5" step = "0.5" data-size = "xl"
Data-symbol = "symbol" data-default-caption = "{rating} hearts" data-star-captions = "{}">

Step 3: If you need to reset or submit the button, introduce the following code:

Copy codeThe Code is as follows:
<Button type = "submit" class = "btn-primary"> Submit </button>
<Button type = "reset" class = "btn-default"> Reset </button>

Step 4: Introduce the js call code:

Copy codeThe Code is as follows:
<Script>
JQuery (document). ready (function (){
$ (". Rating-kv"). rating ();
});
</Script>

Download demo address on this site

The above is all the content of this article. I hope you will like it.

Related Article

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.