Star Rating widget for jQuery UI

让人想犯罪 __ 提交于 2019-12-05 04:21:16

usually jquery ui css files refer images from folder named images put is same directory as css file. So you need to either change path of refered images in ui.stars.js.

  |
  --images
     |
     ---image files are here
  |
  --ui.stars.css

When using orkans' star_rating you need to tell it to convert radiobuttons to stars explicitly, like this (I use jQuery.noConflict mode):

jQuery(document).ready(function($){
  $("#stars-wrapper1").stars();
}

I found out, that problem with the versoion I have downloaded is, that object o is not initialized ok in the _init function (the defaults from the end of ui.star.js are not loaded). This object also sets the CSS values (classes). I haven't found the solution yet, but a simple workaround would be, to fill those values at initialization of stars on your page:

  <script type="text/javascript">
    $("#stars-wrapper1").stars({
    cancelClass: "ui-stars-cancel",
    starClass: "ui-stars-star",
    starOnClass: "ui-stars-star-on",
    starHoverClass: "ui-stars-star-hover",
    starDisabledClass: "ui-stars-star-disabled",
    cancelHoverClass: "ui-stars-cancel-hover",
    cancelDisabledClass: "ui-stars-cancel-disabled"
    });
  </script>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!