Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,626 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,061 people online right now. Registration is fast and FREE... Join Now!




Change Scroll Bar Color In FireFox and Opera?

3 Pages V  1 2 3 >  
Reply to this topicStart new topic

Change Scroll Bar Color In FireFox and Opera?, How Is This Done?

getlowdogg369
post 22 Apr, 2006 - 11:00 AM
Post #1


New D.I.C Head

*
Joined: 26 Dec, 2005
Posts: 23



Thanked 1 times
My Contributions


Hello everyone. I am using the folowing CSS code to change the color of the Scroll Bar.
CODE
BODY{scrollbar-3dlight-color:#FFFFFF; scrollbar-arrow-color:#FFFFFF; scrollbar-base-color:#FF9900; scrollbar-darkshadow-color:#333333; scrollbar-face-color:#FF9900; scrollbar-highlight-color:#FFFFFF; scrollbar-shadow-color:#000000; }

How do I make it so it changes the color of the Scroll Bar in FireFox and Opera also? Thanks!

~ Jason

This post has been edited by getlowdogg369: 22 Apr, 2006 - 11:02 AM
User is offlineProfile CardPM

Go to the top of the page

sontek
post 22 Apr, 2006 - 11:30 AM
Post #2


D.I.C Regular

Group Icon
Joined: 13 Sep, 2001
Posts: 283



Thanked 1 times

Dream Kudos: 85
My Contributions


Firefox doesn't support that because changing the browser is messing with the clients preferences and shouldn't be a 'style' setting. But you can do it with javascript if you really need it, But remember some people are visually impaired and have specific settings for their GUI and you'll be messing with it.
User is offlineProfile CardPM

Go to the top of the page

getlowdogg369
post 22 Apr, 2006 - 11:34 AM
Post #3


New D.I.C Head

*
Joined: 26 Dec, 2005
Posts: 23



Thanked 1 times
My Contributions


How would I do it with JavaScript? Can you please provide me with a code? Thanks!

~ Jason
User is offlineProfile CardPM

Go to the top of the page

danielle_1_uk
post 22 Apr, 2006 - 11:37 AM
Post #4


D.I.C Head

Group Icon
Joined: 22 Feb, 2006
Posts: 242



Dream Kudos: 95
My Contributions


I had a quick google and apparently

QUOTE
One important thing you must know about a colored scrollbar is that it does not do not work in Gecko-based browsers (Firefox, Netscape Navigator, Mozilla): It is an Internet Explorer's only property. It is not a standard property or a proprietary property. According to W3C, these properties are illegal: they are neither defined in any CSS specification nor are they marked as proprietary (by prefixing them with "-vendor-").


From here

This post has been edited by danielle_1_uk: 22 Apr, 2006 - 11:38 AM
User is offlineProfile CardPM

Go to the top of the page

getlowdogg369
post 22 Apr, 2006 - 11:51 AM
Post #5


New D.I.C Head

*
Joined: 26 Dec, 2005
Posts: 23



Thanked 1 times
My Contributions


This is not telling me how to change the Scroll Bars in FireFox...
User is offlineProfile CardPM

Go to the top of the page

danielle_1_uk
post 22 Apr, 2006 - 12:03 PM
Post #6


D.I.C Head

Group Icon
Joined: 22 Feb, 2006
Posts: 242



Dream Kudos: 95
My Contributions


QUOTE(getlowdogg369 @ 22 Apr, 2006 - 07:43 PM)
This is not telling me how to change the Scroll Bars in FireFox...

As far as I know you can't. I thought even the JavaScript way only allows you to do it in IE 5.5+. I am probably wrong on this, so I would wait for a JavaScripter's opinion.

EDIT: all I know is you can't do it with html/css. And the html you've written to allow it in IE wont validate either.

This post has been edited by danielle_1_uk: 22 Apr, 2006 - 12:06 PM
User is offlineProfile CardPM

Go to the top of the page

getlowdogg369
post 22 Apr, 2006 - 12:39 PM
Post #7


New D.I.C Head

*
Joined: 26 Dec, 2005
Posts: 23



Thanked 1 times
My Contributions


Ok. So sontek, so you know how?
User is offlineProfile CardPM

Go to the top of the page

Arbitrator
post 23 Apr, 2006 - 01:34 AM
Post #8


D.I.C Regular

Group Icon
Joined: 26 Jan, 2005
Posts: 492



Thanked 1 times
My Contributions


CSS scrollbar properties are proprietary standards of Microsoft and thus will only work in Internet Explorer. The best you can do is to create a simulated scrollbar that serves the same purpose; you can't alter the real scrollbar styles in Firefox.

It's unfortunate though. I'm all for standards but that's one of the few MS proprietary codes that doesn't hurt anything while adding a little spice to the design.
User is offlineProfile CardPM

Go to the top of the page

masada
post 9 May, 2006 - 12:40 PM
Post #9


New D.I.C Head

*
Joined: 9 May, 2006
Posts: 4


My Contributions


give this a shot:
Cross-Browser Custom Scrollbar
User is offlineProfile CardPM

Go to the top of the page

masada
post 10 May, 2006 - 12:00 PM
Post #10


New D.I.C Head

*
Joined: 9 May, 2006
Posts: 4


My Contributions


Cancel that last entry. That thing is a joke.
Here's what you can do to make this work in all 3 major browsers (IE, Firefox, Opera):

1) use this code:

CODE

<style>
body{
   scrollbar-face-color: #808080; /*/ obviously change this to whatever you want /*/
   scrollbar-arrow-color: #FFFFFF;
   scrollbar-highlight-color: #FFFBF0;
   scrollbar-3dlight-color: #808080;
   scrollbar-shadow-color: #FFFBF0;
   scrollbar-darkshadow-color: #808080;
   scrollbar-track-color: #CCCCCC;
}
</style>
<script>
function selectCode(f){
document.forms[f].elements[0].focus();
document.forms[f].elements[0].select();
}
function changeScrollbarColor(C){
 if (document.all){
   document.body.style.scrollbarBaseColor = C
 }  
}
</script>


2) in the HTML tag of your webpage, delete ANY and ALL ties to W3C! For example, you will see code generated in the HTML tag when you create a new html page in Dreamweaver like this:

CODE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


Kill all of this so the only thing left is the following:

CODE

<html>


Near as I can tell, what this does is break away from the rules that have been established by the W3 consortium so anything can be read and followed. I don't know why, but it just seems to work. I have tried this script method in all three browsers and it works in all of them.


cheers
User is offlineProfile CardPM

Go to the top of the page

MIP
post 12 Nov, 2006 - 10:48 AM
Post #11


New D.I.C Head

*
Joined: 12 Nov, 2006
Posts: 2



Thanked 1 times
My Contributions


QUOTE(masada @ 10 May, 2006 - 01:00 PM) *

Cancel that last entry. That thing is a joke.
Here's what you can do to make this work in all 3 major browsers (IE, Firefox, Opera):

1) use this code:

CODE

<style>
body{
   scrollbar-face-color: #808080; /*/ obviously change this to whatever you want /*/
   scrollbar-arrow-color: #FFFFFF;
   scrollbar-highlight-color: #FFFBF0;
   scrollbar-3dlight-color: #808080;
   scrollbar-shadow-color: #FFFBF0;
   scrollbar-darkshadow-color: #808080;
   scrollbar-track-color: #CCCCCC;
}
</style>
<script>
function selectCode(f){
document.forms[f].elements[0].focus();
document.forms[f].elements[0].select();
}
function changeScrollbarColor(C){
 if (document.all){
   document.body.style.scrollbarBaseColor = C
 }  
}
</script>


2) in the HTML tag of your webpage, delete ANY and ALL ties to W3C! For example, you will see code generated in the HTML tag when you create a new html page in Dreamweaver like this:

CODE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


Kill all of this so the only thing left is the following:

CODE

<html>


Near as I can tell, what this does is break away from the rules that have been established by the W3 consortium so anything can be read and followed. I don't know why, but it just seems to work. I have tried this script method in all three browsers and it works in all of them.


cheers

User is offlineProfile CardPM

Go to the top of the page

MIP
post 12 Nov, 2006 - 10:55 AM
Post #12


New D.I.C Head

*
Joined: 12 Nov, 2006
Posts: 2



Thanked 1 times
My Contributions


Near as I can tell this does not work in Mozilla. I pasted the code by Masada into a new blank page, set an onload event onload="changeScrollbarColor() to set scroll bar to "black" in the body of the new page and previewed in Mozilla (version 2.0) browser. Same old "light blue" scrollbar. Tested it in version 1.0.5.8 and same thing. Here is the "code" i tried for the new page:

<html>
<head>
<title>New Page 4</title>
<style>
body{
scrollbar-face-color: #000000; /*/ obviously change this to whatever you want /*/
scrollbar-arrow-color: #FFFFFF;
scrollbar-highlight-color: #FFFBF0;
scrollbar-3dlight-color: #808080;
scrollbar-shadow-color: #000000;
scrollbar-darkshadow-color: #808080;
scrollbar-track-color: #cccccc;
}
</style>
<script>
function selectCode(f){
document.forms[f].elements[0].focus();
document.forms[f].elements[0].select();
}
function changeScrollbarColor©{
if (document.all){
document.body.style.scrollbarBaseColor = C
}
}
</script>
</head>
<body onload="changeScrollbarColor()">
</body>
</html>

It seems this stuff about reference to W3C is just not correct and that Mozilla refuses to recognize anything which messes with their browser.



QUOTE(masada @ 10 May, 2006 - 01:00 PM) *

Cancel that last entry. That thing is a joke.
Here's what you can do to make this work in all 3 major browsers (IE, Firefox, Opera):

1) use this code:

CODE

<style>
body{
   scrollbar-face-color: #808080; /*/ obviously change this to whatever you want /*/
   scrollbar-arrow-color: #FFFFFF;
   scrollbar-highlight-color: #FFFBF0;
   scrollbar-3dlight-color: #808080;
   scrollbar-shadow-color: #FFFBF0;
   scrollbar-darkshadow-color: #808080;
   scrollbar-track-color: #CCCCCC;
}
</style>
<script>
function selectCode(f){
document.forms[f].elements[0].focus();
document.forms[f].elements[0].select();
}
function changeScrollbarColor(C){
 if (document.all){
   document.body.style.scrollbarBaseColor = C
 }  
}
</script>


2) in the HTML tag of your webpage, delete ANY and ALL ties to W3C! For example, you will see code generated in the HTML tag when you create a new html page in Dreamweaver like this:

CODE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


Kill all of this so the only thing left is the following:

CODE

<html>


Near as I can tell, what this does is break away from the rules that have been established by the W3 consortium so anything can be read and followed. I don't know why, but it just seems to work. I have tried this script method in all three browsers and it works in all of them.


cheers

User is offlineProfile CardPM

Go to the top of the page

3 Pages V  1 2 3 >
Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 03:33AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month