PDA

View Full Version : how to have a colored scrollbar in vb3 ?


deathemperor
02-17-2004, 08:40 AM
like the one of vb3 ACP, it's dark blue
how to make one for main forum ? I tried but didn't know how to get it correct.
thank you

Andreas
02-17-2004, 08:49 AM
Not possible if you want compliant CSS, as there is no attribute for specifying scrollbar color.

If you don't care: Set scrollbar-base-color, scrollbar-3dlight-color, scrollbar-arrow-color, scrollbar-darkshadow-color, scrollbar-face-color, scrollbar-highlight-color, scrollbar-shadow-color and scrollbar-track-color for the BODY-Tag.

Brad
02-17-2004, 09:07 AM
And do remember, only IE users will see it.

Natch
02-17-2004, 10:44 AM
Not possible if you want compliant CSS, as there is no attribute for specifying scrollbar color.

If you don't care: Set scrollbar-base-color, scrollbar-3dlight-color, scrollbar-arrow-color, scrollbar-darkshadow-color, scrollbar-face-color, scrollbar-highlight-color, scrollbar-shadow-color and scrollbar-track-color for the BODY-Tag.
You can still have compliant CSS :) :) Do it with Javascript :) ;)

NOTE: this is script I wrote by hand - feel free to use it but PLEASE leave the acknowledgement in ... it *should* retain colours that fit with your style automatically :) but of course will only render colours in IE

<script type="text/javascript">
<!--
/* START I.E. only Flat ScrollBar Colour Script for use with CSS2 Validation */
/* coded by Natch - mobileforces.org */
bg = window.document.bgColor;
txt = window.document.fgColor;
if (document.all){
with (window.document.body.style){
scrollbarBaseColor=bg;
scrollbarFaceColor=bg;
scrollbarHighlightColor=txt;
scrollbar3dLightColor=bg;
scrollbarShadowColor=txt;
scrollbarDarkShadowColor=bg;
scrollbarArrowColor=txt;
scrollbarTrackColor=txt;
}
}
/* END I.E. only Flat ScrollBar Colour Script for use with CSS2 Validation */
//-->
</script>


(NB: your CSS won't be compliant, but doing it via Javascript will hide your non-compliant CSS from the validator :p)

Andreas
02-17-2004, 11:15 AM
Well ... yes ;)
Although I wouldn't do this.

deathemperor
02-17-2004, 01:24 PM
Not possible if you want compliant CSS, as there is no attribute for specifying scrollbar color.

If you don't care: Set scrollbar-base-color, scrollbar-3dlight-color, scrollbar-arrow-color, scrollbar-darkshadow-color, scrollbar-face-color, scrollbar-highlight-color, scrollbar-shadow-color and scrollbar-track-color for the BODY-Tag.
I did this, the scrollbar of the textarea works but not the main window T_T
Natch, yours doesn't seem to work either. Sorry for my idiot question but how can I set up colors in your code ?
Of course I'm using IE.
thank you guys

Natch
02-17-2004, 01:59 PM
I did this, the scrollbar of the textarea works but not the main window T_T
Natch, yours doesn't seem to work either. Sorry for my idiot question but how can I set up colors in your code ?
Of course I'm using IE.
thank you guys
Actually I've found this script to fail on IE6, so Don't use it for a live board ... (it used to work on IE5.x)

If you wanna set up colours in the code I posted, you replace the txt and bg entries on each line with '#******' where the *'s are your RRGGBB colour codes ... (but as I said it will give u javascript errors in IE6 so don't use it :)

deathemperor
02-18-2004, 01:05 AM
thanks anyway, it's nothing with changing color when it doesn't work T_T

NTLDR
02-18-2004, 01:39 PM
Just put:


html {
scrollbar-base-color: #E7E5E6;
scrollbar-arrow-color: #334B71;
}


in the additional css box in the style manager, obviously putting in your own colours.

deathemperor
02-19-2004, 12:41 AM
thank you NTLDR, it works !

MPDesignZ
03-02-2007, 04:24 PM
Just put:


html {
scrollbar-base-color: #E7E5E6;
scrollbar-arrow-color: #334B71;
}


in the additional css box in the style manager, obviously putting in your own colours.

Thank you that worked! :D

MP