Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/spheresoftware/jquery_rating


https://github.com/spheresoftware/jquery_rating

Last synced: about 1 month ago
JSON representation

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)
```