• jquery 点击同级元素隐藏,再点击显示


      <div class="downdiv" v-for="item in  accountList">
            <div class="down_time" onclick="show(this)">
                <div class="times" style=" 39%;padding-left: 2%">{{item.count.doDate}} {{item.count.week}}</div>
                <div class="times" style=" 55%">
                    <span style="color: #ec8a17">本金:</span>
                    <span>{{item.count.principal}}</span>
                    &nbsp;&nbsp;
                    <span style="color: #42aeec">佣金:</span>
                    <span>{{item.count.commission}}</span>
                </div>
            </div>
            <div class="down_account" v-for="account,index in item.alist">
                <div class="a_left">
                    <div class="a_left_img">
                        <img src="img/tao.jpg" style=" 100%;height: 100%">
                    </div>
                    <div class="a_left_info">
                        <div class="a_left_info_up">
                            {{account.platformName}}
                        </div>
                        <div class="a_left_info_down">
                            <span>{{account.hourTime}}</span>
                            <span>{{account.goods}}</span>
                        </div>
                    </div>
                </div>
                <div class="a_right">
                    <div class="a_right_up">
                        <div class="ben_info">-{{account.principal}}</div>
                        <div class="ben_img" style=" border: 1px solid #ff640e; color:#ff640e;"></div>
                    </div>
                    <div class="a_right_down">
                        <div class="yong_info">+{{account.commission}}</div>
                        <div class="yong_img" style=" border: 1px solid #4ea5ff; color:#4ea5ff;"></div>
                    </div>
                </div>
            </div>
        </div>
    accountList 结构:List<Map<String,Object>>
    map中的Object存了两种形式;一种是对象Map<String,AccountCount>,另一种是对象集合Map<String,List<AccountVo>>

    js:
    <script type="text/javascript" src="js/jQueryRotate.js"></script>//旋转插件

    1、下载地址:https://www.jb51.net/jiaoben/554113.html

    function shou(obj) {
            var showState = $(obj).siblings();
            //第三个子元素的子元素
            var roimg = $(obj).children(":eq(2)").children();
    
            if(showState.is(':hidden')){  //如果当前隐藏
                showState.show();  //那么就显示div
                $(obj).children('img').rotate(0);
                roimg.rotate(0);
    
            }else{  //否则
                showState.hide();  //就隐藏div
                roimg.rotate(90);
                //$(".roimg").rotate(90);//顺时针旋转90度
            }
    
        }
  • 相关阅读:
    bzoj2818
    bzoj1901
    bzoj1010
    loj6277
    bzoj1001
    bzoj1787
    选项卡
    日期选择器
    去掉文本框的外边框
    bootstarp 模态框大小尺寸的控制
  • 原文地址:https://www.cnblogs.com/dk2557/p/14676802.html
Copyright © 2020-2023  润新知