Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jqueryui的星级小部件_Jquery_User Interface_Jquery Plugins_Rating - Fatal编程技术网

jqueryui的星级小部件

jqueryui的星级小部件,jquery,user-interface,jquery-plugins,rating,Jquery,User Interface,Jquery Plugins,Rating,我被介绍到了jqueryui的应用程序。 我最初使用的是 使用两者之间有什么区别吗 试着使用jQueryUIOne,我无法让输入按钮显示为星星。我包括以下js和css文件: <script src="jquery-1.3.2.min.js" type="text/javascript"></script> <script src="jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script

我被介绍到了jqueryui的应用程序。 我最初使用的是

使用两者之间有什么区别吗

试着使用jQueryUIOne,我无法让输入按钮显示为星星。我包括以下js和css文件:

<script src="jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>
<script src="ui.stars.js" type="text/javascript"></script>
<link href="ui.stars.css" type="text/css" rel="stylesheet" />

对于我的代码,简单地说:

<form>
    Rating: <span id="stars-cap"></span>
    <div id="stars-wrapper1">
        <input type="radio" name="newrate" value="1" title="Very poor" />
        <input type="radio" name="newrate" value="2" title="Poor" />
        <input type="radio" name="newrate" value="3" title="Not that bad" />
        <input type="radio" name="newrate" value="4" title="Fair" />
        <input type="radio" name="newrate" value="5" title="Average" checked="checked" />
        <input type="radio" name="newrate" value="6" title="Almost good" />
        <input type="radio" name="newrate" value="7" title="Good" />
        <input type="radio" name="newrate" value="8" title="Very good" />
        <input type="radio" name="newrate" value="9" title="Excellent" />
        <input type="radio" name="newrate" value="10" title="Perfect" />
    </div>
</form>

评级:

所有文件和图像都在同一文件夹中。我以前从未使用过jQueryUI,所以我不确定我所需要的是否就是那个文件。我也不确定它是否需要它,我使用的另一个星级插件并不需要它。有人知道我遗漏了什么吗?

通常jquery ui css文件引用名为
images
put的文件夹中的图像,该文件夹与css文件的目录相同。因此,您需要更改ui.stars.js中引用图像的路径

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

当使用orkans的star_评级时,您需要告诉它显式地将单选按钮转换为star,如下所示(我使用jQuery.noConflict模式):


我发现,我下载的versoion的问题是,对象o在_init函数中没有正确初始化(ui.star.js末尾的默认值没有加载)。此对象还设置CSS值(类)。我还没有找到解决方案,但一个简单的解决方法是,在初始化页面上的星号时填充这些值:

  <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>

$(“#stars-wrapper1”).stars({
cancelClass:“ui星星取消”,
starClass:“用户界面之星”,
starOnClass:“用户界面上的星星”,
星空悬停类:“ui星空悬停”,
starDisabledClass:“用户界面已禁用星星”,
取消悬停类:“ui星星取消悬停”,
cancelDisabledClass:“用户界面星型取消禁用”
});

wird,我创建了images文件夹并将ui.stars.gif放在里面,但仍然没有运气。
  <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>