how to create a Custom Scrollbar



how to create a Custom Scrollbar..

Answer / Vishal Saxena

Here is an example of creating a custom scrollbar using JavaScript and CSS:nnHTML:n```htmln<!DOCTYPE html>n<html lang="en">n<head>n <meta charset="UTF-8">n <title>Custom Scrollbar</title>n <style>n /* Add custom scrollbar styles */n body {n overflow: hidden;n position: relative;n }n body::-webkit-scrollbar {n width: 12px;n height: 12px;n }n body::-webkit-scrollbar-track {n background-color: #f5f5f5;n }n body::-webkit-scrollbar-thumb {n background-color: #ccc;n border-radius: 6px;n }n </style>n</head>n<body>n <h1>Your Content Here</h1>n</body>n</html>```nnJavaScript:nNo JavaScript code is needed in this example as the scrollbar styles are defined using CSS.n

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Code Interview Questions

code to detect versions of different browsers like internet explorer, netscape, mozilla, opera etc

1 Answers   HCL,


Create a ViewState Property?

1 Answers   TCS,


write a code that user can choose/alter Body Text Size

1 Answers  


create a slide show

1 Answers   Genpact,


Create a Menu that can be activated while clicking on Right Mouse button

1 Answers   Nest, TCS,


determine which key was pressed and its type

1 Answers  


code to calculate the number of days between two dates

2 Answers  


Code for Adding Message and Confirmation Boxes Using JavaScript?

1 Answers  


code to keep a page Out of the browser history

1 Answers  


code to create a new window

1 Answers  


program that will accept any name and will be stored in an array

2 Answers  


code to detect availability of cookies

1 Answers  


Categories
  • PHP Code Interview Questions PHP Code (33)
  • JSP Code Interview Questions JSP Code (6)
  • ASP Code Interview Questions ASP Code (5)
  • CGI Perl Code Interview Questions CGI Perl Code (3)
  • JavaScript Code Interview Questions JavaScript Code (63)
  • VB Script Code Interview Questions VB Script Code (20)
  • Shell Script Code Interview Questions Shell Script Code (31)
  • Python Code Interview Questions Python Code (34)
  • WinRunner Code Interview Questions WinRunner Code (1)
  • HTML DHTML XHTML Code Interview Questions HTML DHTML XHTML Code (13)
  • XML Interview Questions XML (43)
  • Scripts_Markup Code AllOther Interview Questions Scripts_Markup Code AllOther (5)