隐藏mozilla firefox上的滚动条

时间:2016-08-30 09:04:17

标签: javascript html css firefox scroll

我正在创建一个Web应用程序,但我似乎无法摆脱Mozilla Firefox上菜单的滚动条。它在我测试的每个浏览器中都能很好地工作,除了firefox。

这是我用于卷轴的css,到目前为止适用于Chrome,IE,Edge和Opera,但不适用于Firefox。

.main-sidebar{
        position:fixed
    }

    .bar{
        max-height: 400px; 
        overflow-y: scroll;
    }
    .bar::-webkit-scrollbar {
        display: none;
    }

    .bar {
        -ms-overflow-style: none; 
        overflow:hidden;
    }


    html {
        overflow: scroll;
        overflow-x: hidden;
    }
    ::-webkit-scrollbar {
        width: 0px;  /* remove scrollbar space */
        background: transparent;  /* optional: just make scrollbar invisible */
    }

.bar是div的类,我希望隐藏滚动。菜单滚动得很好,但它没有隐藏在Firefox上。 有什么想法吗?

2 个答案:

答案 0 :(得分:0)

在您的webkit-scrollbar上试试这个:

private boolean isValidEmail(String email) {// validation for email Id
    boolean isValid = false;
    String expression = "^[\\w\\.-]+@([\\w\\-]+\\.)+[A-Z]{2,255}$";

    Pattern pattern = Pattern.compile(expression, Pattern.CASE_INSENSITIVE);
    Matcher matcher = pattern.matcher(email);
    if (matcher.matches()) {
        isValid = true;

    }
    return isValid;
}

它应该有用。

答案 1 :(得分:0)

请尝试一下对我来说很好。

*{
   scrollbar-width: none;
 }
相关问题