1

Simple question :

how to set other to display block only selected onlick on particular div will display block the rest will display:none.

jQUERY :

$('.menu_jyclass').click(function(){
            var vr=$(this).attr('vr')
            $(".table_main").hide()
            $("#main_"+vr).show();
            $('.menu_jyclass').removeClass('cur');
            $(this).addClass('cur') 
        });

      $("#hn").click(function () {
        $("#zhifubaoDiv").css("display","block")
        // $("#").show();   
    });

        $("#wx").click(function () {
        $("#wangyincunkuan2Div").css("display","block")
        // $("#").show();   
    });

HTML

  <a class="menu_jyclass" id="hn" vr="hn">微信支付</a>
  <a class="menu_jyclass cur" id="wx" vr="wx">在线支付</a>

 <div id="zhifubaoDiv" class="ListItemSub clearfix" style="display: none;">
 <div id="wangyincunkuan2Div" class="ListItemSub clearfix" style="display:none;">

1 Answer 1

2

Try this:

Javascript:

$("#hn").click(function () {
        $("#wangyincunkuan2Div").css("display","none")
        $("#zhifubaoDiv").css("display","block")
        // $("#").show();   
    });

    $("#wx").click(function () {
        $("#wangyincunkuan2Div").css("display","block")
        $("#zhifubaoDiv").css("display","none")
        // $("#").show();   
    });

Fiddle Here: https://jsfiddle.net/c8czc69e/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.