Using jquery rateit plugin in select box

I have the following select form element and want to apply rateit jquery plugin to it .

<select class="test" id="Rating" name="Rating">
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
  <option value="5">5</option>
</select>

and I'm trying to apply the plugin with $("select.test").rateit();, but even though the fireQuery showing the data attaches a select element that has no effect, and I still have a select box, not a star string.

EDIT

CSS file included

Here is the page in question

+3
source share
1 answer

You are using the plugin incorrectly. See a very simple example: http://jsfiddle.net/rudiedirkx/ZuJ2k/

selectshould be there, but you still have to refer to divwhen calling the plugin:$('div#rating2').rateit();

div select : data-rateit-backingfld="select#Rating"


, ? ?


:

rateItDiv = $('<div class="rateit" data-rateit-backingfld="#Rating"></div>');
$("div#ReviewInputZone select.test").after(rateItDiv);
$('div#rateit').rateit();

div#rateit, div . div.rateit, div#rateit. , . #, ( , ).

, :

rateItDiv = $('<div id="rateit" class="rateit" data-rateit-backingfld="#Rating"></div>');


, . Javascript (Firebug FF Chrome) : jQuery('div.rateit').rateit();

+2

All Articles