Computing.Net > Forums > Web Development > Scrollbar not necessary

Scrollbar not necessary

Reply to Message Icon

Original Message
Name: Zenno
Date: May 22, 2004 at 17:22:06 Pacific
Subject: Scrollbar not necessary
OS: Windows XP
CPU/Ram: P4 1.8 / 1.5 G
Comment:

Hello everybody,

We all know that with a little code like this, we can add colored scrollbar in a web page:

<STYLE type="text/css">

</STYLE>

But with this the scrollbar appear even if i don't need them, when the screen resolution is high. How can this code be modify to appear only when necessary ?

Thans a lot.

Zenno


Report Offensive Message For Removal

Response Number 1
Name: Zenno
Date: May 22, 2004 at 17:34:10 Pacific
Subject: Scrollbar not necessary
Reply: (edit)

The code did not appear on my preceding post, maybe due to a restriction on computing.net.

Anyway i put it in a text file on my website:

http://www.familleboutet.com/familleboutet.com/code.rtf


Report Offensive Follow Up For Removal

Response Number 2
Name: tImmaY
Date: May 23, 2004 at 11:04:44 Pacific
Subject: Scrollbar not necessary
Reply: (edit)

body {
overflow: hidden;
}


Report Offensive Follow Up For Removal

Response Number 3
Name: Zenno
Date: May 23, 2004 at 11:20:28 Pacific
Subject: Scrollbar not necessary
Reply: (edit)

That's it ??

Great..Thank you tImmaY

Zenno.


Report Offensive Follow Up For Removal

Response Number 4
Name: Zenno
Date: May 23, 2004 at 13:16:50 Pacific
Subject: Scrollbar not necessary
Reply: (edit)

I tried it, but it dows not solve my problem.

It does remove the scrollbar but i want this only for screen at higher resolution, i still want the scrollbar to appear at 800x600 or 1024x768.

I placed your code at several different places but with the same result.

Zenno.


Report Offensive Follow Up For Removal

Response Number 5
Name: chaud
Date: May 23, 2004 at 17:00:25 Pacific
Subject: Scrollbar not necessary
Reply: (edit)

That hides the scrollbar, java could do this for you, make it check the resoulotion, and if above whatever, insert that code...

Excell Hosting for all your hosting needs.


Report Offensive Follow Up For Removal


Response Number 6
Name: Zenno
Date: May 23, 2004 at 19:24:43 Pacific
Subject: Scrollbar not necessary
Reply: (edit)

Chaud, your code did not appear in your preceding post,

What is the code please ?

Zenno


Report Offensive Follow Up For Removal

Response Number 7
Name: SN
Date: May 23, 2004 at 23:59:38 Pacific
Subject: Scrollbar not necessary
Reply: (edit)

Zenno-
Read up on the Overflow CSS property. I can't stand custom scrollbars, so I have never used them, but changing it to:

overflow: auto;

should work. This should go in with all your scrollbar properties:

scrollbar-arrow-color:#000000;
scrollbar-track-color:#43493B;
overflow: auto;

If that doesn't work, we may end up having to use javascript (NOT java...The two are barely related). But that would be a lame solution, so just keep your fingers crossed.

-SN


Report Offensive Follow Up For Removal

Response Number 8
Name: Zenno
Date: May 24, 2004 at 03:19:29 Pacific
Subject: Scrollbar not necessary
Reply: (edit)

Yes it worked.

Thank you very much everyone.

Zenno.


Report Offensive Follow Up For Removal

Response Number 9
Name: tImmaY
Date: May 25, 2004 at 09:12:02 Pacific
Subject: Scrollbar not necessary
Reply: (edit)

so then how would you make a javascript choose which style sheet to use depending on the browser size? i know how to determine browser size but i dont know how to make it use a dif. style sheet depending on the resolution.


Report Offensive Follow Up For Removal

Response Number 10
Name: tImmaY
Date: May 25, 2004 at 09:30:56 Pacific
Subject: Scrollbar not necessary
Reply: (edit)

nvm, this worked:
<> = []
[script language="javascript"]
var correctwidth = 1024
var correctheight = 768

if (screen.width > correctwidth||screen.height > correctheight)
document.write ("<link rel='stylesheet' type='text/css' href='style.css'>")
else if (screen.width <= correctwidth||screen.height <= correctheight)
document.write("<link rel='stylesheet' type='text/css' href='style1.css'>")
[/script]


Report Offensive Follow Up For Removal






Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Scrollbar not necessary

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software