/    Sign up×
Community /Pin to ProfileBookmark

I need Help in my Script to adjust scrollbars based on screen resolution??

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

?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Mr_JAug 12.2003 — 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
Copy linkTweet thisAlerts:
@AschauthorAug 13.2003 — It works great Mr J,

i made it really to complicated....

many many thx ?)

? ? ?


see ya

asch
×

Success!

Help @Asch spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...