Technology Software

How to Change the Scroll Bar Color Using JavaScript

    • 1). Launch your website design software, HTML editor or a plain text editor tool such as Microsoft Notepad.

    • 2). Open the Web page on which you want to change the color of the scroll bar.

    • 3). Scroll to the body section of the Web page. This is the text and code located between the opening "<body>" tag and closing "</body>" tag. Click on the page immediately after the opening "<body>" tag.

    • 4). Paste the following code into the insertion location:

      <script language="JavaScript1.2">

      <!--

      /*---For flat scrollbars. Colors: line1 - , line2 - #ffffff, face1 - #0066ff, face2 - #ffffff*/

      function clrBar(line,face)

      {

      with(document.body.style)

      {

      scrollbarDarkShadowColor=line;

      scrollbar3dLightColor=line;

      scrollbarArrowColor="black";

      scrollbarBaseColor=face;

      scrollbarFaceColor=face;

      scrollbarHighlightColor=face;

      scrollbarShadowColor=face;

      scrollbarTrackColor="#F3F3F3";

      }

      }

      function setcolor()

      {

      var w = document.body.clientWidth;

      var h = document.body.clientHeight;

      var x = event.clientX;

      var y = event.clientY;

      if(x>w) clrBar("","#0066ff"); // Colors of active state

      else clrBar("#ffffff","#ffffff"); // Colors of normal state

      }

      if (document.all){

      clrBar(null,null);

      document.onmousemove=setcolor;

      }

      -->

      </script>

    • 5). Change each color attribute in the pasted code to your preferred colors. The color attribute is the six digit-code following the "#" key. You can use an online color-picker tool to get the correct color codes for your chosen colors. In this example, the main face color of the scroll bar is orange with a black border.

    • 6). Save the edited Web page, and upload it to your host's server.

SHARE
RELATED POSTS on "Technology"
local area network (LAN)
local area network (LAN)
How to Make Watermarks
How to Make Watermarks
How to Convert RTF to Doc
How to Convert RTF to Doc
How to Insert a Check Box in Word 2007
How to Insert a Check Box in Word 2007
How to Digital Scrapbook With Adobe Photoshop
How to Digital Scrapbook With Adobe Photoshop
RiT PatchView: Designing Your Own Personal Network With Technicians' Assisting in the Performance
RiT PatchView: Designing Your Own Personal Network With Technicians' Assisting in the Performance
Best Things About Software Development Services In India
Best Things About Software Development Services In India
Diwali Festival New Year Offer For School Management System
Diwali Festival New Year Offer For School Management System
How to Edit Pictures to Make Teeth Whiter
How to Edit Pictures to Make Teeth Whiter
3 Quick Fix Solutions to Common DVD Driver Issues
3 Quick Fix Solutions to Common DVD Driver Issues
How to Make a Java Game With NetBeans
How to Make a Java Game With NetBeans
Convert Offline EDB to PST When Exchange Server Crashed
Convert Offline EDB to PST When Exchange Server Crashed
How to Compress BMP Files
How to Compress BMP Files
How to View Two PowerPoint 2007 Presentations in Sync
How to View Two PowerPoint 2007 Presentations in Sync
How to Convert AVI to MPEG2 in Linux
How to Convert AVI to MPEG2 in Linux
xinetd
xinetd
How to Design a Corporate Enterprise Email System
How to Design a Corporate Enterprise Email System
Solving Complex Data Migration Problems With ET Tools
Solving Complex Data Migration Problems With ET Tools
Web Development Being Powered by Ajax Programming!
Web Development Being Powered by Ajax Programming!
Biztalk Server Deployment A Challenging Task For Deploying Over A Remote Account
Biztalk Server Deployment A Challenging Task For Deploying Over A Remote Account
Great Plains Small Business Financials Upgrade Overview For Consultant
Great Plains Small Business Financials Upgrade Overview For Consultant
Choosing The Right Mobile Application Development Platforms: Tips And Guidelines
Choosing The Right Mobile Application Development Platforms: Tips And Guidelines
Taking A Closer Look At SugarSynch
Taking A Closer Look At SugarSynch
Online Scheduling Software- How Online Scheduling Software Can Revolutionize Your Business
Online Scheduling Software- How Online Scheduling Software Can Revolutionize Your Business

Leave Your Reply

*