https://github.com/spheresoftware/jquery_rating
https://github.com/spheresoftware/jquery_rating
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/spheresoftware/jquery_rating
- Owner: SphereSoftware
- Created: 2015-05-27T09:06:06.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-06-05T00:44:30.000Z (almost 11 years ago)
- Last Synced: 2025-01-24T17:36:44.869Z (over 1 year ago)
- Language: JavaScript
- Size: 160 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rating
jQuery plugin to display rating component
## Installation
Include script after the jQuery library:
```html
```
## Usage
Create an html element on the page
```html
```
Initialize rating component when scripts loaded:
```javascript
$('.rating_element').rating();
```
This will create rating component with default settings.
## Customization
Plugin supports next options:
```javascript
$('.rating_element').rating({
orientation: 'horizontal',
width: 300,
height: 30,
scale: 1.5,
grades: ['5','4','3','2','1'],
grade: 1,
onGradeChanged: function () {}
});
```
```javascript
orientation: 'horizontal/vertical' // define orientation of the component
```
```javascript
width: 200 // define width of maximized component
height: 20 // define height of maximized component
```
```javascript
scale: 1.5 // define how many times minified component will be related to maximized component. eg. 300/1.5 = 200
```
```javascript
grades: ['great', 'good', 'better', 'woops', 'bad'] // define grades that will be displayed on the page.
```
```javascript
grade: 2 // Define at which grade component will be initialized. eg. 2 => good
```
```javascript
onGradeChanged: function () {} // callback to be called when user confirm selection of grade (click on grade in maximized view)
```