How to make rating

How to make rating

Creation of ratings – process quite useful as they can give considerable support in creation and promotion of website and blogs. And in general, it can look quite beautifully. Visitors can evaluate any given materials of the website or the blog, whether it be article, image and so on. Today we will talk about a plug-in for jQuery which creates ratings. This plug-in is called "jQuery Star Rating Plugin", it is very convenient and easy to use and does not require great efforts for work with it. So, let's try to create rating on the website.

It is required to you

  • plug-in of "jQuery Star Rating Plugin"

Instruction

1. Download jQuery plug-in in network. Connect library of a plug-in and its files.

2. With a plug-in find the CSS file in archive and connect it.

It looks so:

3. Create group of radio buttons:
As a result of asterisks will be as much how many and buttons.

Now you already have quite operable plug-in, however it can also be configured.

4. To use fractional numbers (that is that the visitor could select, for example, assessment 4.5). For this purpose use the class attribute. Set it in a view:
class= "" star {split: 2 }"
where 2 – quantity of parts into which you separate an asterisk.

If you want some quantity of asterisks to be by default selected, then use an attribute of checked= "" checked"".

5. To process and analyze results of vote, remember: the plug-in changes a page marking, instead of radio buttons there is a hidden field which will contain results of vote.

For the example given above this field will look approximately so:
Here, in general, and all. It is really quite convenient plug-in which is not requiring great efforts in work with it. Good luck to you in creation of own ratings!

Author: «MirrorInfo» Dream Team


Print