首页 > 解决方案 > 粘性标题在移动模式下不滚动

问题描述

进入移动模式并且粘性标题不会滚动,它将保持在固定位置。

随机糟糕的尝试并将一些 CSS 拼凑在一起。

这是当前粘性标题的 CSS。(我在插件中使用它,但这是插件中的 css)

#site-logo-inner, #site-header-inner {
    transition: all .3s ease-in-out;
}
#site-header #site-logo #site-logo-inner a img {
    transition: all .3s ease-in-out;
}
.fixed_sticky_active #site-header #site-logo #site-logo-inner a img {
    max-height: 50px!important;
} 

@media(min-width: 960px){
    .fixed_sticky_active #site-logo-inner {
        height: 74px!important;
    }
    .fixed_sticky_active #site-navigation-wrap .dropdown-menu >li >a {
        line-height: 74px!important;
        display: inline-block!important;
    }
    .fixed_sticky_active #site-header {
        opacity: 1;
    }
}

@media(max-width: 480px){
    .fixed_sticky_active #site-header {
        top: 0;
    }
    .fixed_sticky_active #site-header-inner {
        padding: 0;
    }
}

我试过这个;

@media(max-width: 480px){
    .fixed_sticky_active #site-header {
        max-height: 100vh;
        overflow: auto;
        top: 0;
        -webkit-overflow-scrolling: touch;
    }
    .fixed_sticky_active #site-header-inner {
        padding: 0;
        max-height: 100vh;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
}

(完全不确定我在做什么,但我在另一篇文章中将其视为修复,但没有奏效:()

标签: wordpressmobilescrollheadersticky

解决方案


推荐阅读