菜单遮盖问题

develop
就眠仪式 2020-08-24 17:02:00 +08:00
parent f6e62d9671
commit ebc099e1ff
1 changed files with 13 additions and 1 deletions

View File

@ -361,7 +361,19 @@ layui.define(['table', 'jquery', 'element'], function(exports) {
if (b) {
$("#" + option.elem + ".pear-nav-mini .layui-nav-item,#" + option.elem + ".pear-nav-mini dd").hover(function() {
$(this).children(".layui-nav-child").addClass("layui-nav-hover");
var top = $(this).offset().top + 5;
var y = window.document.body.clientHeight;
var height = $(window).height();
var topLength = $(this).offset().top;
var thisHeight = $(this).children(".layui-nav-child").height();
if((thisHeight+topLength)>height){
topLength = height-thisHeight-10;
}
if (!$(this).is(".layui-nav-item")) {
var left = $(this).offset().left + 132;
$(this).children(".layui-nav-child").offset({
@ -374,7 +386,7 @@ layui.define(['table', 'jquery', 'element'], function(exports) {
});
}
$(this).children(".layui-nav-child").offset({
top: top
top: topLength
});
}, function() {
$(this).children(".layui-nav-child").removeClass("layui-nav-hover");