View Full Version : scrollbar in forms

Jul 9th, 2002, 11:34 AM
How can I assign a css style (scrollbar) to the whole document? I know to do this for a html page, but in the form (ex: list/menu) the scroll bar remained unchanged. I tried some JS, but it didn't work (I'm still learning).

Thanks, Alina.

Jul 9th, 2002, 01:43 PM
The only,so called, CSS that changes scrollbars,is colored scrollbars in IE and Konqueror.And you can't apply it to dropdown menus,and probably it doesnt work on lists too.

Jul 9th, 2002, 03:51 PM
If you define a <div> class with a fixed size using width and height in your style definition, you can use the overflow property to determine what will happen to any content that extends beyond the bounds of the <div>. The allowable options are visible, hidden, scroll and auto. Visible and hidden aren't too useful. The scroll option always leaves the scrollbars, even if the content fits within the <div>; auto only uses them if the content is too large to fit.

Jul 9th, 2002, 04:16 PM
Ok, if the CSS doesn't work, how can I change the appearence of the scrollbar for a list/menu? JS?

Jul 9th, 2002, 06:20 PM
Originally posted by alina
Ok, if the CSS doesn't work, how can I change the appearence of the scrollbar for a list/menu? JS?

You can't

Sorry I can't offer more help, but those are the facts.


Jul 9th, 2002, 09:42 PM
You can use javaScript to make any <div> move in any direction. You can trigger this movement with a onmouseDown() event. You can also define a clipping window that restricts the visible area of your layer to a fixed size. The idea is that if you trigger an upward movement of, say, 6 pixels for your layer, you simultaneously move your clipping window down 6 pixels so that the visible window stays in the same spot, but the content behind it appears to scroll up. Constructing actual scroll bars, or sliders, would be a bit more complex, but certainly do-able. It's easier to simply have an arrow up and arrow down icon, and have each trigger a function that handles the scrolling when the mouse button is pressed over it. IE has a feature called ScrollHeight that determines the actual depth of the scrolling content so you can determine when you've actually reached the bottom, and stop the scrolling. I'm not sure how it would be done in NN6, but if your content is fixed, you would simply hard code the values. It involves a lot of scripting, but if you want to customize the appearance, it's an option.