“JavaScript Scrollbar” Kode Jawaban

Scrollbar khusus

body::-webkit-scrollbar {
  width: 12px;               /* width of the entire scrollbar */
}
body::-webkit-scrollbar-track {
  background: orange;        /* color of the tracking area */
}
body::-webkit-scrollbar-thumb {
  background-color: blue;    /* color of the scroll thumb */
  border-radius: 20px;       /* roundness of the scroll thumb */
  border: 3px solid orange;  /* creates padding around scroll thumb */
}
Elated Eagle

JavaScript Scrollbar

// OverflowX and OverflowY properties in Javascript

// x-axis scroll bar

document.getElementById("myId").style.overflowX = "scroll"; 

// y-axis scroll bar 

document.getElementById("myId").style.overflowY = "scroll"; 

// both x-axis and y-axis scroll bar

document.getElementById("myId").style.overflow = "scroll"; 

// To remove overflow, do the following:

document.getElementById("myId").style.overflow = "hidden"; 
ayaan

Jawaban yang mirip dengan “JavaScript Scrollbar”

Pertanyaan yang mirip dengan “JavaScript Scrollbar”

Lebih banyak jawaban terkait untuk “JavaScript Scrollbar” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya