...

View Full Version : I made a scroll bar, but the real one disappeared.



techgearfree
02-26-2005, 07:46 AM
You can view what I am talknig about on www.techgearfree.com

I tried to make the middle section a scroll bar. It works. However, when the page fits on your monitor, the built-into-the-browser scroll bar disappears completely. When the page doesn't fit, the bar will reappear and function correctly.

To make my scroll bar, in my template, I put this in my style section:

#scroll
{
height:100%;
overflow:auto;
scrollbar-face-color:2B638C;
scrollbar-3dlight-color:black;
scrollbar-darkshadow-color:black;
}

Then later, in the area where I want the stuff in the scroll box, I put:

<td height="300" width=100% align="center" bgcolor="#FFFFFF"><div id="scroll"> <FORM action="register.php" method="get">
<p><font face="Arial, Helvetica, sans-serif"><br>
<font color="#173147" size="5" face="Eurostile">Pick Your <strong>FREE</strong> Gift:</font></font></p>
<table width="80%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">

When I remove:

#scroll
{
height:100%;
overflow:auto;
scrollbar-face-color:2B638C;
scrollbar-3dlight-color:black;
scrollbar-darkshadow-color:black;
}

The page has the scroll bar on the right, however, the scroll bar I want to make, obviously is not made when I remove the code.

Any tips?

Thanks

gsnedders
02-26-2005, 02:06 PM
CSS:
body {
overflow: scroll;
}

techgearfree
02-26-2005, 07:23 PM
In the past, I have had problems not knowing how to insert a css code. My page has a style area in it, and I tried to insert it like this:

<style class="text/css">

body {
overflow: scroll;
}

But it did not fix it. If I have inserted it correctly, it might not be working because my page has 3 different files: header.tpl index.tpl and footer.tpl. I tried to put it in header.tpl

Thanks


EDIT: I looked at the code, and it looks like it says if it overflows, show the scroll bar. My page already does this. The problem is when the page is not overflown, it doesn't have the faded out scroll bar it usually should.

rmedek
02-26-2005, 07:29 PM
I tried to make the middle section a scroll bar. It works. However, when the page fits on your monitor, the built-into-the-browser scroll bar disappears completely. When the page doesn't fit, the bar will reappear and function correctly.
I am so confused. So, you're saying when there isn't enough content to overflow the page, the scroll bar doesn't appear? Isn't that supposed to happen?

What exactly is your question? How to have a scroll bar in the middle section? How to have the colored scroll bar? How to keep a scroll bar in the body?


EDIT: I looked at the code, and it looks like it says if it overflows, show the scroll bar. My page already does this. The problem is when the page is not overflown, it doesn't have the faded out scroll bar it usually should.

Why would it have a scrollbar if there was nothing to scroll?

techgearfree
02-26-2005, 07:42 PM
My problem is when I use the small scroll bar in the middle of the page, the built in browser one on the right hand side of the page disappears. Well, on normal pages, the scroll bar is faded out.

If the content fits on the page, then if you refresh the page a coupkle times, you see the bar show up, then disappear and the content is pushed alittle over to the right

If I take the scroll bar I made off of the page, it will show the bar on the right.

rmedek
02-26-2005, 10:04 PM
Okay. Maybe I should clarify a few things... first, you didn't "make" a scrollbar. You've only assigned colors (IE only, btw) to the scrollbar if one happens to be there. Since you've declared "overflow: auto" to the div, a scrollbar will appear when there is more content than the div can fit.

If you take the #scroll bit out, you're not taking away the scrollbar, you're actually just taking away the properties that contain all the info within that certain amount of space. So the content overflows and there will be a new scrollbar, one on the browser window, that lets you see everything.

Unless you're doing something in Flash you don't have control over scrollbars-- at least not to the point where you can have one appear if there is no need for one. (as far as I know)

This is about all I can make of your problem; other than than I'm not sure I understand exactly what the problem is. I know the scrollbars are disappearing/appearing at times, but what is the behavior you want out of them?

techgearfree
02-26-2005, 10:34 PM
I fixed the problem. In index.php for the popup item descriptions, I had this in:

<style>

body
{
height: 100%;
overflow: auto;
}
div.nav {
position: absolute;
top: x;
left: y;
}
body>div.nav {
position: fixed;
}
</style>

I took it out, and the scroll bar is now there.



Thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum