“Ubah warna scrollbar” Kode Jawaban

Ubah warna scrollbar

.scrollable-element {
  scrollbar-color: red yellow; /* red is for the thumb and yellow is for the track */
}
Super Sloth

scrollbar-color

<head>
    <style>
        .newScrollBar {
            scrollbar-3dlight-color: #4FBDDD;
            scrollbar-arrow-color: #EEE1AE;
            scrollbar-darkshadow-color: #000000;
            scrollbar-face-color: #A0CCE0;
            scrollbar-highlight-color: #F8F2DC;
            scrollbar-shadow-color: #176F99;
            scrollbar-track-color: #E7F2FA;

            overflow: scroll;
            width: 200px;
            height: 167px;
            border: 1px solid #cccccc;
        }
    </style>
</head>
<body>
    <div class="newScrollBar">
        Look at the colors of the scroll-bars.<br />
        ....................................................<br />
        ....................................................<br />
        Look at the colors of the scroll-bars.<br />
        ....................................................<br />
        ....................................................<br />
        Look at the colors of the scroll-bars.<br />
    </div>
</body>
Omar Mohamed

JavaScript pada gulir perubahan nav warna

$(function () {
  $(document).scroll(function () {
    var $nav = $(".navbar-fixed-top");
    $nav.toggleClass('scrolled', $(this).scrollTop() > $nav.height());
  });
});
Filthy Falcon

Scrollbar dengan 2 warna berbeda di halaman yang sama CSS

::-webkit-scrollbar-track {
    background-color: #333;
}

/* Override styles for <div>s, for example */
div::-webkit-scrollbar-track {
    background-color: #b13131;
}
Coercivemessser

Jawaban yang mirip dengan “Ubah warna scrollbar”

Pertanyaan yang mirip dengan “Ubah warna scrollbar”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya