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);
}
});
}