通过选定的星图对视觉和后端进行评级时出现问题 选择输入类型收音机的隐藏值

Posted

技术标签:

【中文标题】通过选定的星图对视觉和后端进行评级时出现问题 选择输入类型收音机的隐藏值【英文标题】:problems while rating via selected star images for vision and back end select hidden value of input type radio 【发布时间】:2013-04-03 12:25:10 【问题描述】:

您好,我正在尝试通过视觉单击星形图像来获取输入类型收音机的值 我在这方面取得了成功,但我被困在重置另一行的明星形象 看看这个小提琴http://jsfiddle.net/sarfarazdesigner/T9nxq/

我已经描述了我所做的事情,我接受了输入类型的收音机并给了他position relative 再拿一个div 给他position absolute 并把它放在那个特定的inputsclickingimage 我将input 设置为click 在这我成功获得价值但我卡住了在 设置星星图像请帮助我,对不起我的英语谢谢:-)

<div class="ratingDiv review">
    <div class="row">
        <label class="lbl">Features : </label>
        <div class="ratingwrap">
            <div style="position:relative;">
                <div class="fkdiv">
                    <input type="radio" id="poor" class="rtchk"  name="Features"  value="1" />
                    <input type="radio" id="average" class="rtchk"  name="Features" value="2" checked="checked" />
                    <input type="radio" id="good" class="rtchk"  name="Features" value="3" />
                    <input type="radio" id="verygood" class="rtchk"  name="Features" value="4" />
                    <input type="radio" id="excellent" class="rtchk"  name="Features" value="5" />
                </div>
                <div class="rateMe" title="Rate Me...">
                    <a id="_1" title="poor" class="hvr"></a>
                    <a id="_2" title="average" class="hvr"></a>
                    <a id="_3" title="good" class="hvr"></a>
                    <a id="_4" title="verygood" class="hvr"></a>
                    <a id="_5" title="excellent" class="hvr"></a>
                </div>
                <div class="rateStatus">this is awesome</div>
            </div>
        </div>
    </div>

    <div class="row">
        <label class="lbl">Support : </label>
        <div class="ratingwrap">
            <div style="position:relative;">
                <div class="fkdiv">
                    <input type="radio" id="poor" class="rtchk"  name="Support"  value="1" />
                    <input type="radio" id="average" class="rtchk"  name="Support" value="2" checked="checked" />
                    <input type="radio" id="good" class="rtchk"  name="Support" value="3" />
                    <input type="radio" id="verygood" class="rtchk"  name="Support" value="4" />
                    <input type="radio" id="excellent" class="rtchk"  name="Support" value="5" />
                </div>
                <div class="rateMe" title="Rate Me...">
                    <a id="_6" title="poor" class="hvr"></a>
                    <a id="_7" title="average" class="hvr"></a>
                    <a id="_8" title="good" class="hvr"></a>
                    <a id="_9" title="verygood" class="hvr"></a>
                    <a id="_10" title="excellent" class="hvr"></a>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <label class="lbl">Userfriendly : </label>
        <div class="ratingwrap">
            <div style="position:relative;">
                <div class="fkdiv">
                    <input type="radio" id="poor" class="rtchk"  name="Userfriendly"  value="1" />
                    <input type="radio" id="average" class="rtchk"  name="Userfriendly" value="2" checked="checked" />
                    <input type="radio" id="good" class="rtchk"  name="Userfriendly" value="3" />
                    <input type="radio" id="verygood" class="rtchk"  name="Userfriendly" value="4" />
                    <input type="radio" id="excellent" class="rtchk"  name="Userfriendly" value="5" />
                </div>
                <div class="rateMe" title="Rate Me...">
                    <a id="_11" title="poor" class="hvr"></a>
                    <a id="_12" title="average" class="hvr"></a>
                    <a id="_13" title="good" class="hvr"></a>
                    <a id="_14" title="verygood" class="hvr"></a>
                    <a id="_15" title="excellent" class="hvr"></a>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <label class="lbl">Customer Values : </label>
        <div class="ratingwrap">
            <div style="position:relative;">
                <div class="fkdiv">
                    <input type="radio" id="poor" class="rtchk"  name="Customer"  value="1" />
                    <input type="radio" id="average" class="rtchk"  name="Customer" value="2" checked="checked" />
                    <input type="radio" id="good" class="rtchk"  name="Customer" value="3" />
                    <input type="radio" id="verygood" class="rtchk"  name="Customer" value="4" />
                    <input type="radio" id="excellent" class="rtchk"  name="Customer" value="5" />
                </div>
                <div class="rateMe" title="Rate Me...">
                    <a id="_16" title="poor" class="hvr"></a>
                    <a id="_17" title="average" class="hvr"></a>
                    <a id="_18" title="good" class="hvr"></a>
                    <a id="_19" title="verygood" class="hvr"></a>
                    <a id="_20" title="excellent" class="hvr"></a>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <label class="lbl">Reliability : </label>
        <div class="ratingwrap">
            <div style="position:relative;">
                <div class="fkdiv">
                    <input type="radio" id="poor" class="rtchk"  name="Reliability"  value="1" />
                    <input type="radio" id="average" class="rtchk"  name="Reliability" value="2" checked="checked" />
                    <input type="radio" id="good" class="rtchk"  name="Reliability" value="3" />
                    <input type="radio" id="verygood" class="rtchk"  name="Reliability" value="4" />
                    <input type="radio" id="excellent" class="rtchk"  name="Reliability" value="5" />
                </div>
                <div class="rateMe" title="Rate Me...">
                    <a id="_21" title="poor" class="hvr"></a>
                    <a id="_22" title="average" class="hvr"></a>
                    <a id="_23" title="good" class="hvr"></a>
                    <a id="_24" title="verygood" class="hvr"></a>
                    <a id="_25" title="excellent" class="hvr"></a>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <label class="lbl">After Sales Services : </label>
        <div class="ratingwrap">
            <div style="position:relative;">
                <div class="fkdiv">
                    <input type="radio" id="poor" class="rtchk"  name="Services"  value="1" />
                    <input type="radio" id="average" class="rtchk"  name="Services" value="2" checked="checked" />
                    <input type="radio" id="good" class="rtchk"  name="Services" value="3" />
                    <input type="radio" id="verygood" class="rtchk"  name="Services" value="4" />
                    <input type="radio" id="excellent" class="rtchk"  name="Services" value="5" />
                </div>
                <div class="rateMe" title="Rate Me...">
                    <a id="_26" title="poor" class="hvr"></a>
                    <a id="_27" title="average" class="hvr"></a>
                    <a id="_28" title="good" class="hvr"></a>
                    <a id="_29" title="verygood" class="hvr"></a>
                    <a id="_30" title="excellent" class="hvr"></a>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <label class="lbl">Over all Rating : </label>
        <div class="ratingwrap">
            <div style="position:relative;">
                <div class="fkdiv">
                    <input type="radio" id="poor" class="rtchk"  name="rating"  value="1" />
                    <input type="radio" id="average" class="rtchk"  name="rating" value="2" checked="checked" />
                    <input type="radio" id="good" class="rtchk"  name="rating" value="3" />
                    <input type="radio" id="verygood" class="rtchk"  name="rating" value="4" />
                    <input type="radio" id="excellent" class="rtchk"  name="rating" value="5" />
                </div>
                <div class="rateMe" title="Rate Me...">
                    <a title="poor" class="hvr"></a>
                    <a title="average"  class="hvr"></a>
                    <a title="good" class="hvr"></a>
                    <a title="verygood" class="hvr"></a>
                    <a title="excellent" class="hvr"></a>
                </div>
            </div>
        </div>
    </div>
</div><!--rating review div end here-->

【问题讨论】:

这样的? jsfiddle.net/T9nxq/1 你做了什么我不明白。和我的代码一样 当我们点击任何一行并在此之后选择我的第一个评级时,当我们转到另一行时,默认情况下选择我的鼠标所在的位置,我的问题是我想在选择后将评级变量设置为 false确实它非常令人困惑 这个怎么样? jsfiddle.net/T9nxq/4 它工作得很好但是 :-( 现在点击任何一行时都会出现一点问题,如果我们将鼠标移到该行,星星会自动填充,我们的鼠标在该特定行上移动,请检查又来了 【参考方案1】:

几个小时后,我终于解决了星星的问题,看看这个链接 jsfiddle.net/sarfarazdesigner/myLTC/1/ 我得到了我想要的东西,归功于@Morpheus 和我的一点点:-)

【讨论】:

以上是关于通过选定的星图对视觉和后端进行评级时出现问题 选择输入类型收音机的隐藏值的主要内容,如果未能解决你的问题,请参考以下文章

从 TextArea 拖动选定文本时出现 Javafx 问题

前端对接接口时出现数据错值(前后端均无报错)

前端和后端如何进行交互流程

尝试上传文件时出现“已被 CORS 策略阻止”

Word打印预览时出现空白页怎么回事、如何删除?

如何使用 OIDC (vuejs + nodejs) 对前端和后端进行身份验证?