tags:

views:

326

answers:

4

I've got a client with an HTML page with a couple of scrolling divs with text content. She's using a heavily image-based design so the default scroll bars don't suit it at all. She'd like to use a different style but to my knowledge that isn't possible.

What do you think?

A: 

Its kind of possible.

body {
    scrollbar-face-color: #ffffff;
    scrollbar-highlight-color: #000000;
    scrollbar-shadow-color: #ffffff;
    scrollbar-3dlight-color: #ffffff;
    scrollbar-arrow-color: #000000;
    scrollbar-track-color: #808080;
    scrollbar-darkshadow-color: #000000;
}

Note:: It may not work if you have specified an XHTML Doctype!!

simplyharsh
Works fine in XHTML. The trick is, when you are using a Standards Mode DOCTYPE (which you should be, whether you are using HTML or XHTML), the element IE puts the viewport's main scrollbars on is ‘html’, not ‘body’. Just setting on ‘html’ is fine anyway as these properties inherit.
bobince
+8  A: 

There's a jQuery answer to this -

jScrollPane

There are some nice examples of the effects it can achieve

Russ Cam
Only bad thing with using jScrollPane is that you can't use the arrow keys to scroll up and down within the content area, which degrades the usability a little (though this might be achievable using another jQuery plugin).
Mun
@Mun, This problem is reported as a bug in the project's bug tracker. Since this issue is important to me, I plan on submitting a bug fix for it within the next week or so.
Dan Herbert
This is the solution I went with and I like the way it looks/functions. The client is pleased as well, which is even more important!
Bloudermilk
@Mun- keyboard navigation is now supported
Russ Cam
+1  A: 

You can change the colours with CSS but IIRC only IE v5.5+ supports this CSS. Other browsers do not!

See here for a demo: http://www.iconico.com/CSSScrollbar/

Gary Willoughby
The new Safari nightlys have support for this.. but different CSS properties IIRC.
alex
+9  A: 

From a usability point of view, changing scroll bars is a no-go. The user is familiar with his/her operating system and the visual environment it provides. Changing this does create confusion, especially among those who are new to using computers, old people etc.

The majority of users today will probably recognize a scroll bar as long as it has it's basic shape - and many will not even use the bar itself, but just the scroll wheel on the mouse.

It's still a thing to think about though. Consider your audience. And whatever you do make sure it actually works on all platforms/in all browsers if you use a custom scroll bar.

Arve Systad