Javascript Fyneworks jQuery星级评定插件-一半评定

Javascript Fyneworks jQuery星级评定插件-一半评定,javascript,jquery,css,Javascript,Jquery,Css,我正在尝试为文章实现一个星级系统,并找到了一个不错的插件。我已将默认的star.gif与我自己的星星进行了交换。如果我使用全明星评级,一切正常。当我尝试使用分割星号功能时,星号将不再正确显示 恒星本身的宽度为32像素 半星应该在全星的右侧上方 以下if条款似乎负责计算头寸: // Prepare division control if(typeof control.split=='number' && control.split>0){ var stw = ($.

我正在尝试为文章实现一个星级系统,并找到了一个不错的插件。我已将默认的star.gif与我自己的星星进行了交换。如果我使用全明星评级,一切正常。当我尝试使用分割星号功能时,星号将不再正确显示

恒星本身的宽度为32像素

半星应该在全星的右侧上方

以下if条款似乎负责计算头寸:

// Prepare division control
if(typeof control.split=='number' && control.split>0){
    var stw = ($.fn.width ? star.width() : 0) || control.starWidth;
    var spi = (control.count % control.split), spw = Math.floor(stw/control.split);
    star
    // restrict star's width and hide overflow (already in CSS)
    .width(spw)
    // move the star left by using a negative margin
    // this is work-around to IE's stupid box model (position:relative doesn't work)
    .find('a').css({ 'margin-left':'-'+ (spi*spw) +'px' })
};
它被嵌入一个“每颗星对应”的循环中。我已经用firebug调试过了,计算结果似乎是正确的。每一颗恒星的左边距应该是-16px。 但由于某些原因,这并没有显示在网站上

有人知道我做错了什么吗?我必须提到,我没有太多的JS经验

以下是css:

div.rating-cancel, div.star-rating {
    background: none repeat scroll 0 0 transparent;
    cursor: pointer;
    display: block;
    float: left;
    height: 32px;
    overflow: hidden;
    text-indent: -999em;
    width: 17px;
}

div.rating-cancel, div.rating-cancel a {
    background: url("delete.gif") no-repeat scroll 0 -16px rgba(0, 0, 0, 0);
}

div.star-rating, div.star-rating a {
    background: url("star.gif") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
}

div.rating-cancel a, div.star-rating a {
    background-position: 0 0;
    border: 0 none;
    display: block;
    height: 100%;
    width: 32px;
}

div.star-rating-on a {
    background-position: 0 -32px !important;
}

div.star-rating-hover a {
    background-position: 0 -64px;
}

div.star-rating-readonly a {
    cursor: default !important;
}

div.star-rating {
    background: none repeat scroll 0 0 transparent !important;
    overflow: hidden !important;
}

我真的不知道这里出了什么问题。首先,必须调整此设置中的宽度。然后,您可能希望放弃float选项,而是在显示器上使用inline块。这样,将在新行中绘制以下组件

div.rating-cancel, div.star-rating {
    background: none repeat scroll 0 0 transparent;
    cursor: pointer;
    display: inline-block;
    height: 32px;
    overflow: hidden;
    text-indent: -999em;
    width: 32px;
}
如果我用firebug更改此值,则不会发生任何事情。我用原始文件替换了css,然后又添加了我需要的更改,瞧,现在一切看起来都很好