相关疑难解决方法(0)

隐藏仅在Windows上显示的无用滚动条

我的导航栏中有一个引导下拉列表,显示了一个通知列表.这是非常标准的代码,但我设置max-height: 300px;overflow-y: scroll;开启ul元素.在Chrome或Firefox的Mac上查看时,在高度达到> 300px并且ul溢出滚动之前,没有滚动条.但是在Windows(Chrome或IE)上,垂直滚动条始终存在,这真的很烦人.有没有办法关闭Windows上的滚动条或隐藏它直到它实际需要?

以下是下拉列表的代码:

<li class="dropdown notifier">
    <div class="dropdown-toggle" style="width:initial;">
        <div class="dropdown-link nav-dropdown-link" id="dropdownMenuNotifications" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            <i class="fa" ng-class="unreadNotices > 0 ? 'fa-bell-o red' : 'fa-bell-o'" style="position:absolute;right:5px;"></i>&nbsp;
            <div class="counter" ng-if="unreadNotices > 0">{{unreadNotices}}</div>
        </div>
        <ul class="dropdown-items dropdown-menu account" aria-labelledby="dropdownMenuNotifications">
            <li>
                <a href="#" class="title"><span>Notifications</span></a>
            </li>
            <li ng-if="notices.length === 0">
                <a href="#" style="cursor:default;">
                    <div class="notice-text">
                        <span>No notifications at the moment</span>
                    </div>
                </a>
            </li>
            <li ng-repeat-start="n in notices" ng-if="!n.read">
                <a href="#" class="unread" ng-if="n.action" ng-click="markRead(n, …
Run Code Online (Sandbox Code Playgroud)

html css windows scrollbar

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

标签 统计

css ×1

html ×1

scrollbar ×1

windows ×1