wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Adding horizontal scroll bars to list box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Adding horizontal scroll bars to list box" Watch "Adding horizontal scroll bars to list box" New topic
Author

Adding horizontal scroll bars to list box

ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 214
How can i add horizontal scroll bar to list box ??
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can not

Eric
ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 214
is it ?? i read that you can add scrollbar using CSS , just define height and width attribuite and use that class in any html element it will automatically add scroll bar , i am trying that but i dont know how to import that it in jsp and even then is no clue whether its get added or not as no error no exceptions..
my css code

.listBox-auto {
width: 35%;
height: auto;
}
<Select clas="listBox-auto" .....
></select>
help me out
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can't

Eric
ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 214
Ha ha ,,, you got angree ??

anyways i added scrollbar tp div tag and put Select in Div tag

<style type="text/css">
.scrollable{
overflow: scroll;
width: 250px; /* adjust this width depending to amount of text to display */
/* adjust height depending on number of options to display */
/* border: 1px silver solid; */
}
.scrollable select{
border: none;
}
</style>






<div class="scrollable">
<select name="SubstanceList" class="listBox-auto" id="SubstanceList" multiple width="250" style="width: 250px" size="5" onChange="javascript:validateSelection();">
<option> </option>

</select></div>



it casuse problem it add both horizontal scrollbar and vertical ,
even select tag itself provides vertical scrollbar so i am seeing to vertical scrollbars , need to avoid 1

help
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60071
    
  65

UseCodeTags


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 214
i did not get you
Pushkar Choudhary
Rancher

Joined: May 21, 2006
Posts: 425

ravindra patil wrote:i did not get you

What Bear means is, please use code tags when you post some code, since it's very difficult to read code in the absence of the code tags. Read this for more information.
ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 214
Ok ... i have pasted code considering you will understand it as its looks simple code
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60071
    
  65

ravindra patil wrote:i have pasted code considering you will understand it as its looks simple code

Unformatted code is very hard to read -- even for "simple code".

Most people, myself included, will not bother to read code unless you put it in code tags. ShowSomeEffort!
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Well you did not add scrollbars to the select

You probably want auto instead of scroll.

Eric
ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 214
ok i will try but dont think replacing scroll by auto will do as initially it was set to auto i will confirm once again and let you know


Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Do you even know what auto is?

I love when people say it will not work before they try it.

Eric
ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 214
Hi Eric , i am currently fixing bugs we almost have 140 bugs to fix .do you know why my lead gets angree on me , because when i stuck to particular issue i try to reolve myself without taking any once help even of javaranch also .... that scrollbar issue what i have added here after i put 3 days efforts on that i know little bit about javascript

finally they need output they dont count what efforts you put into


Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
ravindra patil wrote:Hi Eric , i am currently fixing bugs we almost have 140 bugs to fix .do you know why my lead gets angree on me , because when i stuck to particular issue i try to reolve myself without taking any once help even of javaranch also .... that scrollbar issue what i have added here after i put 3 days efforts on that i know little bit about javascript

finally they need output they dont count what efforts you put into



angree = angry

Sounds like you need a new job.

Eric
ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 214
Yes ... do you have any for me
i am ready to relocate
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
ravindra patil wrote:Yes ... do you have any for me
i am ready to relocate


You already failed my interview...lol..

So did auto work or did my idea fail?

Eric
ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 214
no i haven't try yet will try and let you know .. i am not failed in your interview ..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Adding horizontal scroll bars to list box
 
Similar Threads
awt.List and Scrollbar
How can i add Horizantal scrollbar in jsf
Horizontal Scroll bar in List Box
Horizontal Scroll Bar in List Box
need horizontal scrollbar for a select box which has fixed width