dreyescat / bootstrap-rating

Bootstrap Rating is a jQuery plugin that creates a rating control that uses Bootstrap glyphicons for rating symbols.
http://dreyescat.github.io/bootstrap-rating/
MIT License
192 stars 78 forks source link

about setting initial value by jQuery #22

Closed ensean closed 8 years ago

ensean commented 8 years ago

Hi, I tried to set the initial value by jQuery, but I find that the initial value can not be shown unless the mouse flies over it. I also tried to fire the hover event on the rating input, but it doesn't work either...

``` html

javascript $("#evalscore").val(res.evalInfo.score)

dreyescat commented 8 years ago

Hi @ensean,

Check the rate method to see how you can programmatically set the rating value.

Applied to your case it should be something like this:

$("#evalscore").rating('rate', res.evalInfo.score)

Hope it helps!

ensean commented 8 years ago

@dreyescat It works! I should have read the readme.md more carefully. Thanks a lot for your response.