This commit is contained in:
rulingcom 2023-07-27 10:24:21 +08:00
parent 6c3dd50722
commit e56851d1b2
1 changed files with 4 additions and 2 deletions

View File

@ -23,18 +23,20 @@
window.already_fix_first_element = false;
if (!window.has_topest_banner) {
var first_element = $('.header-banner');
var parent_element = $()
var is_header = true;
if(first_element.length == 0){
first_element = $('.layout-content .layout-content-inner').eq(0);
is_header = false;
}else{
if(first_element.html() == ''){
first_element = $('.layout-content .layout-content-inner').eq(0);
is_header = false;
}
}
if(first_element.length != 0){
first_element.css("margin-top", "");
var ele_offset = first_element[0].getBoundingClientRect().top + document.documentElement.scrollTop;
if(first_element.parents('.kenjohn.navFixed').length == 0)
if(!is_header)
ele_offset -= window.top_barrier_height;
if(ele_offset < 0){
first_element.css("margin-top", -ele_offset + "px");