jQuery 評分插件:RateThis.js
RateThis.js 是一個可以輕松實現評分功能的插件。
rateThis
rateThis is a jquery plugin that allows you to easy create rating functionality for your form.
瀏覽器支持
rateThis has been tested and should work in
- Internet Explorer 8+
- Safari
- Firefox
- Chrome
- Opera
示例
You can find some examples here.
用法
Include the code before</body>tag
<script src="/path/to/rateThis.min.js"></script>
Then just add it to one of DOMs elements
<script> $('#elementsID').rateThis(); </script>
API
Settable Options
| Option | Description | Data Type | Default |
|---|---|---|---|
| fullImg | Name of image file to use for displaying current rating | string | 'full.png' |
| emptyImg | Name of image file to use for displaying possible rating | string | 'empty.png' |
| zero | If true, will display image to set value of rating to zero | boolean | false |
| zeroImg | Name of image file to use for displaying zero rating | string | 'zero.png' |
| value | Default value for rating | integer | 1 |
| max | Max value for rating | integer | 5 |
| hover | If true, will display image for highlighting current selected rating | boolean | true |
| hoverImg | Name of image file to use for displaying for highlight | string | 'hover.png' |
| disabled | If true, rating will be displayed as disabled | boolean | false |
| disabledFullImg | Name of image file to use for displaying current rating when disabled | string | 'full.png' |
| disabledEmptyImg | Name of image file to use for displaying possible rating when disabled | string | 'empty.png' |
| disabledZeroImg | Name of image file to use for displaying zero rating when disabled | string | 'zero.png' |
Methods
| 方法 | 描述 |
|---|---|
| disable | Disables the rating |
| enable | Enables the rating |
| update | Updates plugin view, for new input value |
| uncheck | Unchecks the checkbox |
| destroy | Removes plugin functionality |

本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!