Fix bug.
This commit is contained in:
parent
6c3dd50722
commit
e56851d1b2
|
@ -23,18 +23,20 @@
|
||||||
window.already_fix_first_element = false;
|
window.already_fix_first_element = false;
|
||||||
if (!window.has_topest_banner) {
|
if (!window.has_topest_banner) {
|
||||||
var first_element = $('.header-banner');
|
var first_element = $('.header-banner');
|
||||||
var parent_element = $()
|
var is_header = true;
|
||||||
if(first_element.length == 0){
|
if(first_element.length == 0){
|
||||||
first_element = $('.layout-content .layout-content-inner').eq(0);
|
first_element = $('.layout-content .layout-content-inner').eq(0);
|
||||||
|
is_header = false;
|
||||||
}else{
|
}else{
|
||||||
if(first_element.html() == ''){
|
if(first_element.html() == ''){
|
||||||
first_element = $('.layout-content .layout-content-inner').eq(0);
|
first_element = $('.layout-content .layout-content-inner').eq(0);
|
||||||
|
is_header = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(first_element.length != 0){
|
if(first_element.length != 0){
|
||||||
first_element.css("margin-top", "");
|
first_element.css("margin-top", "");
|
||||||
var ele_offset = first_element[0].getBoundingClientRect().top + document.documentElement.scrollTop;
|
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;
|
ele_offset -= window.top_barrier_height;
|
||||||
if(ele_offset < 0){
|
if(ele_offset < 0){
|
||||||
first_element.css("margin-top", -ele_offset + "px");
|
first_element.css("margin-top", -ele_offset + "px");
|
||||||
|
|
Loading…
Reference in New Issue