0

This is a functioning scrollbar style that I use inside the HTML but I need to put it in my JavaScript code.

.large-2 {
  overflow: scroll;
  overflow-y: auto;
  overflow-x: hidden;
  height: 50%;
}

.large-2::-webkit-scrollbar-track {
  border: 1px solid #000000;
  padding: 2px 0;
  background-color: #404040;
}

.large-2::-webkit-scrollbar {
  width: 10px;
}

.large-2::-webkit-scrollbar-thumb {
  border-radius: 10px;
  box-shadow: inset 0 0 6px rgba(0,0,0,.3);
  background-color: #737272;
  border: 1px solid #000;
}

1 Answer 1

0

Instead of div you would add a class name for your scroller:

div {
       height: 100px;
       overflow: auto;
    }

Refer to this link: Adding Scrollbars in HTML

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.