zoukankan      html  css  js  c++  java
  • layer.tips自定义位置

    
    function Definitionlayertips(msg, obj, classObj) {//msg提示信息,obj当前元素,classObj吸附滚动的容器
        obj[0].scrollIntoView({behavior: "instant", block: "center", inline: "nearest"});
        layer.tips(msg, obj, {
            tipsMore: true,
            tips: 2,
            success: function (layero, index) {
                //需要吸附滚动的有滚动条的那个容器
                var domParent = classObj;
                //滚动条当前顶部距离
                var scrollTop = domParent[0].scrollTop;
                var widthTips = domParent[0].scrollWidth - (obj.offset().left + obj[0].scrollWidth);
                widthTips = widthTips>110?110:widthTips;
                //当前 tips 的top + 滚动条的顶部距离 + 容器的顶部距离(如:48)为新的top
                layero.css("top", layero.offset().top + 1 + scrollTop);
                layero.css("left", obj.offset().left + obj[0].scrollWidth + 20);
                layero.css("width", widthTips + 'px');
                $(layero).find("i").css("right",parseInt($(layero).find("i").css("right").split("px")[0]) + widthTips);
                domParent.append(layero);
            }
        });
    }
    
  • 相关阅读:
    java8
    java7
    java6
    java5
    java复习4
    学习笔记
    Reflection笔记
    通过Reflection来获得方法和信息
    學習反射2
    學習反射1
  • 原文地址:https://www.cnblogs.com/yu-du-chen/p/12119942.html
Copyright © 2011-2022 走看看