Select box progressive enhancement with half stars

Mar 7, 2011 at 2:13 PM

Hi, I'm using the select box progressive enhancement approach with rateit. This works fine as long as the ratings are whole numbers (ie 1-5 stars) but not if I allow for half star ratings.

So if I create a select box with values 1-5 and then a div with a rateit class and the appropriate data-rateit-backingfld value, it works fine. But if I then add "half star" values (eg value="0.5",value="1.5" etc) to the select box, the rateit plugin stops functioning. (It displays but the mouseover does not work).


Any ideas why this may be the case?

 

Thanks.

Mar 7, 2011 at 2:15 PM

I'll have a look at it.

Mar 7, 2011 at 2:31 PM

Fixed. You can download version 0.99.1, or get the latest jquery.rateit.js from the Source code.

The problem was that when getting the values from the selectbox, it used parseInt(), instead of Number() or parseFloat().

Mar 7, 2011 at 2:33 PM

Awesome, thank you very much for your extremely swift response.

Mar 7, 2011 at 2:35 PM

You're welcome, and thanks for taking the time to report the problem.