Fix js bug.

This commit is contained in:
rulingcom 2022-11-01 00:24:05 +08:00
parent 25859bda2e
commit 48594e5e21
1 changed files with 3 additions and 2 deletions

View File

@ -752,8 +752,9 @@ function transdate(){
} }
var _this = $(document.activeElement);//$(this); var _this = $(document.activeElement);//$(this);
if($('body').css('position') != 'fixed' && !_this.hasClass('close-screen-btn') && !_this.hasClass('navbar-toggle')){ if($('body').css('position') != 'fixed' && !_this.hasClass('close-screen-btn') && !_this.hasClass('navbar-toggle')){
var ele_offset = _this[0].getBoundingClientRect().top - window.top_barrier_height; var ele_offset = _this[0].getBoundingClientRect().top;
console.log(_this, ele_offset) if(ele_offset.parents('.kenjohn.navFixed').length == 0)
ele_offset -= window.top_barrier_height;
if(ele_offset < 0){ if(ele_offset < 0){
window.scroll(window.temp_scrollX, window.temp_scrollY + ele_offset); window.scroll(window.temp_scrollX, window.temp_scrollY + ele_offset);
window.temp_scrollY = Math.max(window.temp_scrollY + ele_offset, 0); window.temp_scrollY = Math.max(window.temp_scrollY + ele_offset, 0);