相关疑难解决方法(0)

如何在移动菜单打开时禁用后台滚动?

我正在构建一个具有导航菜单的移动响应网站.当我到达菜单底部时 - 如果我到达菜单底部继续滚动 - 它会在后台滚动页面.我该如何禁用它?

到目前为止这是我的jQuery代码:

// When the document is loaded...
$(document).ready(function() {

    $('#mob-menu-btn').click(function(){
        $('.sports').slideToggle("slow");
    })

    $('#sub-menu').click(function(){
        $('.sports2').slideToggle("slow");
    })

});
Run Code Online (Sandbox Code Playgroud)

这是我的CSS:

    .list{
        width: 100%;
        overflow: hidden;
        overflow-y: auto;
        top: -10%;
        overflow: hidden;
        overflow-y: auto;
}


    .sports li{
        list-style-image:none;
        list-style-type: none;
        border-bottom: 2px solid #eeeeee;
        margin-bottom: 0px; 
        margin-left: 0px; 
        padding-top: 15px;
        padding-bottom: 15px;
        padding-left: 10px;
        width:100%;
        font-family: arial;
        text-decoration: none;
        overflow: hidden;
    }
Run Code Online (Sandbox Code Playgroud)

css jquery

16
推荐指数
4
解决办法
4万
查看次数

如何使用响应式菜单防止身体滚动

I am trying to properly implement the Responsive Menu plugin into a wordpress theme. The issue appears when the push-side menu is open, which cause body to move at vertical scroll.

At this moment, there is a solution for this template page that is working amazing and I'm happy with the result.

The question: Taking in consideration Outsource WordPress's answer, which fix the above specified page, is there any possibility to tweak the below code in order to be …

html javascript css wordpress jquery

5
推荐指数
1
解决办法
460
查看次数

标签 统计

css ×2

jquery ×2

html ×1

javascript ×1

wordpress ×1