fix menu error

This commit is contained in:
rulingcom 2021-12-08 02:26:00 +00:00
parent 8f1cea6920
commit d9e49d83fe
1 changed files with 14 additions and 4 deletions

View File

@ -857,11 +857,14 @@ function transdate(){
}); });
}); });
var calc_menu_flag = false;
function calc_menu_pos(){ function calc_menu_pos(){
if ($(window).outerWidth() < 769){ if ($(window).outerWidth() < 769){
calc_menu_flag = false;
$('.modules-menu-level-1').css('right','') $('.modules-menu-level-1').css('right','')
$('.modules-menu-level-1').css('width','') $('.modules-menu-level-1').css('width','')
}else{ }else{
calc_menu_flag = true;
var width = $('#main-nav').outerWidth(); var width = $('#main-nav').outerWidth();
var right = $(window).width() - $('#main-nav').offset().left - width; var right = $(window).width() - $('#main-nav').offset().left - width;
$('.modules-menu-level-1').css('right',right) $('.modules-menu-level-1').css('right',right)
@ -870,17 +873,24 @@ function transdate(){
} }
$(window).resize(function() { $(window).resize(function() {
//$('.modules-menu-level-1').css('left','-'+$('.outdropdowns .dropdowns').offset().left+'px'); //$('.modules-menu-level-1').css('calc_menu_flagleft','-'+$('.outdropdowns .dropdowns').offset().left+'px');
calc_menu_pos(); calc_menu_pos();
window.has_hover = false; window.has_hover = fcalc_menu_flagalse;
if($(window).outerWidth(true) >= 768){ if($(window).outerWidth(true) >= 768){
window.has_hover = true; window.has_hover = true;
} }
}); });
$('#main-nav>li').mouseover(function(){
if (!calc_menu_flag){
calc_menu_pos();
}
});
$(window).load(function(){ $(window).load(function(){
calc_menu_pos(); if($('#main-nav').outerWidth()>50){
calc_menu_pos();
}
$("iframe[src*='google']").attr('title','googleOauth'); $("iframe[src*='google']").attr('title','googleOauth');
}); });