English 中文(简体)
如果儿童纽芬兰语与被点击的纽芬兰语一样,改观白彩。
原标题:Changing div colour if child button is the same as button clicked
  • 时间:2012-04-24 08:10:27
  •  标签:
  • jquery

我用一个元子构造一个组织结构图,每个图表成员都有一个子。 我想改变载有纽芬兰语和同样纽芬兰语的四国语。

例如,在我下面的法典中,如果选择了7770001荷兰语,那么我就想将周围的DIV rocItemTemplate改为不同的颜色,但还有具有同样价值的儿童的其他干.。 谁能帮助?

<div id="RadOrgChart1" class="RadOrgChart RadOrgChart_Default">
<!-- 2012.1.301.40 --><div class="rocViewPort" style="visibility: hidden; width: 800px; ">
    <ul class="rocNodeList rocRootNodeList" style="width: 780px; visibility: visible; ">
        <li class="rocNode rocRootNode" style="width: 770px; "><div class="rocItem rocNoOwnImage">
            <div class="rocItemTemplate">


           <input type="submit" name="ctl43$LinkButtonNode" value="02079891000" id="ctl43_LinkButtonNode" class="middle">

            </div>
        </div><ul class="rocNodeList rocLevel1" style="width: 770px; ">
            <li class="rocNode rocFirst rocLast rocOnly" style="width: 770px; "><div class="rocItem rocNoOwnImage">
                <div class="rocItemTemplate">


           <input type="submit" name="ctl47$LinkButtonNode" value="77770001" id="ctl47_LinkButtonNode" class="middle">

                </div>
            </div><ul class="rocNodeList rocLevel2" style="width: 770px; ">
                <li class="rocNode rocFirst" style="width: 120px; "><div class="rocItem rocNoOwnImage">
                    <div class="rocItemTemplate">


           <input type="submit" value="01494561123" name="ctl51$LinkButtonNode" id="ctl51_LinkButtonNode" class="middle">

                    </div>
                </div><div class="rocNodeLines">
                    <span class="rocLineHorizontal"><!-- --></span><span class="rocLineUp"><!-- --></span>
                </div></li><li class="rocNode" style="width: 120px; "><div class="rocItem rocNoOwnImage">
                    <div class="rocItemTemplate">


           <input type="submit" name="ctl54$LinkButtonNode" value="77770001" id="ctl54_LinkButtonNode" class="middle">

                    </div>
                </div><div class="rocNodeLines">
                    <span class="rocLineHorizontal"><!-- --></span><span class="rocLineUp"><!-- --></span>
                </div></li><li class="rocNode" style="width: 120px; "><div class="rocItem rocNoOwnImage">
                    <div class="rocItemTemplate">


           <input type="submit" name="ctl57$LinkButtonNode" value="77770002" id="ctl57_LinkButtonNode" class="middle">

                    </div>
                </div><ul class="rocNodeList rocLevel3" style="width: 120px; ">
                    <li class="rocNode rocFirst rocLast rocOnly" style="width: 120px; "><div class="rocItem rocNoOwnImage">
                        <div class="rocItemTemplate">


           <input type="submit" name="ctl61$LinkButtonNode" value="0061422226212" id="ctl61_LinkButtonNode" class="middle">

                        </div>
                    </div><div class="rocNodeLines">
                        <span class="rocLineHorizontal"><!-- --></span><span class="rocLineUp"><!-- --></span>
                    </div></li>
                </ul><div class="rocNodeLines">
                    <span class="rocLineHorizontal"><!-- --></span><span class="rocLineUp"><!-- --></span><span class="rocLineDown"><!-- --></span>
                </div></li><li class="rocNode rocLast" style="width: 380px; "><div class="rocItem rocNoOwnImage">
                    <div class="rocItemTemplate">


           <input type="submit" name="ctl64$LinkButtonNode" value="77770003" id="ctl64_LinkButtonNode" class="middle">

                    </div>
                </div><ul class="rocNodeList rocLevel3" style="width: 380px; ">
                    <li class="rocNode rocFirst" style="width: 120px; "><div class="rocItem rocNoOwnImage">
                        <div class="rocItemTemplate">


           <input type="submit" value="0061431540656" name="ctl68$LinkButtonNode" id="ctl68_LinkButtonNode" class="middle">

                        </div>
                    </div><div class="rocNodeLines">
                        <span class="rocLineHorizontal"><!-- --></span><span class="rocLineUp"><!-- --></span>
                    </div></li><li class="rocNode" style="width: 120px; "><div class="rocItem rocNoOwnImage">
                        <div class="rocItemTemplate">


           <input type="submit" value="0061883836198" name="ctl71$LinkButtonNode" id="ctl71_LinkButtonNode" class="middle">

                        </div>
                    </div><div class="rocNodeLines">
                        <span class="rocLineHorizontal"><!-- --></span><span class="rocLineUp"><!-- --></span>
                    </div></li><li class="rocNode rocLast" style="width: 120px; "><div class="rocItem rocNoOwnImage">
                        <div class="rocItemTemplate">


           <input type="submit" value="0061883836255" name="ctl74$LinkButtonNode" id="ctl74_LinkButtonNode" class="middle">

                        </div>
                    </div><div class="rocNodeLines">
                        <span class="rocLineHorizontal"><!-- --></span><span class="rocLineUp"><!-- --></span>
                    </div></li>
                </ul><div class="rocNodeLines">
                    <span class="rocLineHorizontal"><!-- --></span><span class="rocLineUp"><!-- --></span><span class="rocLineDown"><!-- --></span>
                </div></li>
            </ul><div class="rocNodeLines">
                <span class="rocLineHorizontal"><!-- --></span><span class="rocLineUp"><!-- --></span><span class="rocLineDown"><!-- --></span>
            </div></li>
        </ul><div class="rocNodeLines">
            <span class="rocLineHorizontal"><!-- --></span><span class="rocLineUp"><!-- --></span><span class="rocLineDown"><!-- --></span>
        </div></li>
    </ul>
</div><input id="RadOrgChart1_ClientState" name="RadOrgChart1_ClientState" type="hidden">

Edit:

我还要说,当 but子被点击而没有点击次数的所有其他人时,必须改为另一类。

问题回答

这应当做到:

$( [type="submit"] ).click(function() {
    var value = $(this).val();
    $( div:contains([type="submit"][value="  + value +  "]) ).addClass("yourCssClassSpecifyingTheColor");
});

你们可以使用

$( input[value=77770001] ).closest( div ).css( background-color ,"Red");




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签