zoukankan      html  css  js  c++  java
  • 根据某个元素做相对定位

    html

    <div id="scrollLabOrderDetail" class="drug-content" hr-self-height="getLabProjectHeight()" on="clinicInfo.clinicCate">
        <div class="lab-items">
            <ul class="li-striped">
                <li class="li-lab-items" ng-repeat="labItems in labItemsCheck">
                    <label class="checkbox " >
                        <input type="checkbox" ng-model="labItems.checked" ng-disabled="doctorstationParaValue.labMultitpleSelect==1?labItems.disabled:false"
                               ng-change="changeChecked(labItems)"/>
                            <span class='sheet-title overflow-ellipsis'>
                                {{labItems.data.itemName}}
                            </span>
                    </label>
                    <span class="lab-item-more margin-left10" id="labChargeDetail{{$index}}" ng-click="getLabChargeDetail(labItems, $index)">
                        <a class="a-icon a-fs"><span class="more-icon"></span></a>
                    </span>
                    <span class="fg-color-blue specimen-name overflow-ellipsis" ng-if="labItems.checked">{{labItems.data.specimenName}}</span>
                    <span class="lab-item-more" ng-if="labItems.data.type === 1" id="labSheetDetail{{$index}}"
                          ng-click="openLabItemDetail(labItems, $index)">
                        <a>详细<span class="more-icon">?</span></a>
                    </span>
                </li>
            </ul>
        </div>
    </div>
    <div ng-show="labChargeDetailShow" click-outside="closeLabChargeDetail()"
         class="labChargeDetailMark popover fade bottom in  popover-charge">
        <div class="arrow"></div>
        <!--<h3 class="popover-title">{{labSheetTitle}}</h3>-->
        <!--<button type="button" class="close" ng-click="openMrDescPop(0)">&times</button>-->
        <div class="popover-content">
            <ul class="li-striped border-line" ng-show="labChargeDetailList.length > 0">
                <li>收费项目名称</li>
                <li>单价</li>
                <li>单位</li>
                <li>数量</li>
                <li>金额</li>
            </ul>
            <ul class="li-striped border-line-bottom-left-right" ng-repeat="labChargeDetail in labChargeDetailList">
                <li title="{{labChargeDetail.itemName}}">{{labChargeDetail.itemName}}</li>
                <li title="{{labChargeDetail.price}}">{{labChargeDetail.price}}</li>
                <li title="{{labChargeDetail.units}}">{{labChargeDetail.units}}</li>
                <li title="{{labChargeDetail.amount}}">{{labChargeDetail.amount}}</li>
                <li title="{{labChargeDetail.totalPrice}}">{{labChargeDetail.totalPrice}}</li>
            </ul>
        </div>
    </div>

    Js

    if ($scope.labChargeDetailList.length > 0) {
        var mark = $("#labChargeDetail" + index);
        var offset = $(mark).offset();
        var mrDesc = $(".labChargeDetailMark.popover");
        /* if (mrDesc.css("display") === "none") {
         mrDesc.css({top: (offset.top - 67) + "px", left: (offset.left - 116) + "px", display: "block"});
         } else {
         $(".labSheetDetailMark.popover").css({display: "none"});
         }*/
        var numTop =65; //上边距减去的数值
        var numLeft = 300;//左边距减去的数值
        if($(window).width()<1100){
            // 在1024*768下
            numLeft = 212;
        }
        if (!$scope.labChargeDetailShow) {
            if ($scope.clinicInfo.groupOrder === groupOrderEnum.GROUP) {
                mrDesc.css({
                    top: (offset.top - numTop) + "px",
                    left: (offset.left - numLeft) + "px",
                    display: "block"
                });
    
            } else {
                mrDesc.css({
                    top: (offset.top - numTop) + "px",
                    left: (offset.left - numLeft) + "px",
                    display: "block"
                });
    
            }
            $scope.labChargeDetailShow = true;
        } else {
            $scope.labChargeDetailShow = false;
        }
    }
  • 相关阅读:
    无法打开内核设备"\.Globalvmx86": 系统找不到指定的文件问题记录
    docker使用switch to Linux Containers切换不成windows问题
    js设计模式——发布订阅模式
    剑指offer系列——求1+2+…+n
    【转载】CSS3弹性盒布局方式
    【转载】.btc勒索病毒删除+还原文件(Dharma家族新成员)
    【转载】chrome浏览器的跨域设置——包括版本49前后两种设置
    【转载】SVN使用教程总结
    【转载】vue.js移动端app
    【转载】将web项目打包成手机app的方法
  • 原文地址:https://www.cnblogs.com/ms-grf/p/7856713.html
Copyright © 2011-2022 走看看