This commit is contained in:
rulingcom 2022-08-24 19:50:27 +08:00
parent dd72708b34
commit 3ad9b26c9a
1 changed files with 21 additions and 9 deletions

View File

@ -748,16 +748,28 @@ function transdate(){
} }
$(document).on('focusin','*',function(event){ $(document).on('focusin','*',function(event){
// event.stopPropagation(); // event.stopPropagation();
var _this = $(document.activeElement);//$(this); if(window.focus_timeout_id){
var topOffset = window.temp_scrollY + window.top_barrier_height; window.clearTimeout(window.focus_timeout_id);
var ele_offset = _this.offset().top - topOffset;
if(ele_offset < 0){
window.scroll(window.temp_scrollX, window.temp_scrollY + ele_offset);
window.temp_scrollY = Math.max(window.temp_scrollY + ele_offset, 0);
} }
if ($('header>.kenjohn').attr('class') == "kenjohn" && _this.is('a.orbit-bar-logo')){ var _this = $(document.activeElement);//$(this);
$('header>.kenjohn').addClass('navRel'); if(!_this.hasClass('close-screen-btn')){
$('#gotocenter').focus(); var topOffset = window.temp_scrollY + window.top_barrier_height;
var ele_offset = _this.offset().top - topOffset;
if(ele_offset < 0){
window.scroll(window.temp_scrollX, window.temp_scrollY + ele_offset);
window.temp_scrollY = Math.max(window.temp_scrollY + ele_offset, 0);
}
window.focus_timeout_id = window.setTimeout(function(){
var ele_offset = _this.offset().top - topOffset;
if(ele_offset < 0){
window.scroll(window.temp_scrollX, window.temp_scrollY + ele_offset);
window.temp_scrollY = Math.max(window.temp_scrollY + ele_offset, 0);
}
}, 800);
if ($('header>.kenjohn').attr('class') == "kenjohn" && _this.is('a.orbit-bar-logo')){
$('header>.kenjohn').addClass('navRel');
$('#gotocenter').focus();
}
} }
}); });
$('.group').each(function(){ $('.group').each(function(){