This commit is contained in:
rulingcom 2023-02-10 09:06:30 +08:00
parent ed254c1792
commit c409eab1db
2 changed files with 34 additions and 21 deletions

View File

@ -11,6 +11,11 @@
this.replaceWith(new_html);
}
});
try{
var isMobile = (window.matchMedia ? window.matchMedia("(any-pointer:coarse)").matches : ("ontouchstart" in document.documentElement));
}catch(e){
var isMobile = false;
}
function fix_first_element(force_fix) {
if(!force_fix && window.already_fix_first_element){
return;
@ -706,33 +711,35 @@ function transdate(){
window.temp_scrollY = document.documentElement.scrollTop;
window.temp_scrollX = document.documentElement.scrollLeft;
}
$(document).on('focusin','*',function(event){
// event.stopPropagation();
if(window.focus_timeout_id){
window.clearTimeout(window.focus_timeout_id);
}
var _this = $(document.activeElement);//$(this);
if($('body').css('position') != 'fixed' && !_this.hasClass('close-screen-btn') && !_this.hasClass('navbar-toggle')){
var ele_offset = _this[0].getBoundingClientRect().top;
if(_this.parents('.kenjohn.navFixed').length == 0)
ele_offset -= window.top_barrier_height;
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(!isMobile){
$(document).on('focusin','*',function(event){
// event.stopPropagation();
if(window.focus_timeout_id){
window.clearTimeout(window.focus_timeout_id);
}
window.focus_timeout_id = window.setTimeout(function(){
var ele_offset = _this[0].getBoundingClientRect().top - window.top_barrier_height;
var _this = $(document.activeElement);//$(this);
if($('body').css('position') != 'fixed' && !_this.hasClass('close-screen-btn') && !_this.hasClass('navbar-toggle')){
var ele_offset = _this[0].getBoundingClientRect().top;
if(_this.parents('.kenjohn.navFixed').length == 0)
ele_offset -= window.top_barrier_height;
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();
window.focus_timeout_id = window.setTimeout(function(){
var ele_offset = _this[0].getBoundingClientRect().top - window.top_barrier_height;
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(){
if ($(this).text().trim()==''){
$(this).css('padding',0);

View File

@ -147,12 +147,18 @@ body{
.w-ba-banner{
display: flex;
flex-direction: row-reverse;
align-items: center;
.w-ba-banner__wrap{
flex: 0 0 65%;
}
.ad-overlay{
position: relative;
background: none;
width: 35%;
p{
max-width: 100%;
overflow-wrap: break-word;
}
}
}
}