Click to See Complete Forum and Search --> : I need Help in my Script to adjust scrollbars based on screen resolution??


Asch
08-12-2003, 09:13 AM
Hi, So i have tried to make a script that will print scrollbars when a users open the page with a screen reolution lower then 1024*768 and simply does not print them if the user has the same or a higher one ....
Her is what i have done but it does not work could be great if someone could help me ???? thx

----------------------------------
function scrollbar() {
var width = 1024;
var height = 768;
if (screen.width !< width || screen.height !< height) {
with(document.body.style)
{
scrollBar(true);
};
else if (screen.width != width || screen.height != height)
with(document.body.style)
{
scrollBar(null);
};
else if (screen.width !> width || screen.height !> height)
with(document.body.style)
{
scrollBar(null);
};
};

-----------------------------------------------

& I must ad something like that to customize the scrollbar but i dont know how (in the script) :

scrollbarDarkShadowColor="black";
scrollbar3dLightColor="black";
scrollbarArrowColor="white";
scrollbarBaseColor="black";
scrollbarFaceColor="black";
scrollbarHighlightColor="black";
scrollbarShadowColor="black";
scrollbarTrackColor="black";

-----------


i will really appriciate your help thx...since i m not so good in javascript...:o)


cheers

asch


:D

Mr J
08-12-2003, 01:58 PM
For the scrollbar colours

<script>
function init(){
document.body.style.scrollbarFaceColor="black";
document.body.style.scrollbarBaseColor="black";
document.body.style.scrollbarDarkShadowColor="black";
document.body.style.scrollbar3dLightColor="black";
document.body.style.scrollbarArrowColor="white";
document.body.style.scrollbarHighlightColor="black";
document.body.style.scrollbarShadowColor="black";
document.body.style.scrollbarTrackColor="black";
}
</script>


Add

onload="init()"

to the opening BODY tag



To make the scrollbar visible when required add

style="overflow:auto"

to the opening BODY tag

Asch
08-13-2003, 02:19 AM
It works great Mr J,
i made it really to complicated....

many many thx :O)
:D :D :D


see ya

asch