Controlling HTML SELECT vertical scroll bars - Javascript

This is a discussion on Controlling HTML SELECT vertical scroll bars - Javascript ; Hi, I've been searching the net all day today trying to figure out how one would accomplish what I originally thought would be a fairly straight forward and simple thing. The problem I'm trying to solve is that the designer ...

+ Reply to Thread
Results 1 to 5 of 5

Controlling HTML SELECT vertical scroll bars

  1. Default Controlling HTML SELECT vertical scroll bars

    Hi,

    I've been searching the net all day today trying to figure out how one
    would accomplish what I originally thought would be a fairly straight
    forward and simple thing. The problem I'm trying to solve is that the
    designer would like to limit the total number of entires shown when
    you click on the drop-down arrow of a select box. I'm starting to
    think that this isn't possible.

    I've tried the following with no luck:

    - Setting the height attribute on the select element
    - Setting a style height for the select attribute
    - Modifying the same through Javascript
    - Setting the style overflow-y to scroll
    - Setting the size of the select element

    At some point in my browsing someone claimed that the vertical scroll
    bars are controlled by the OS/Browser and there are no ways to change
    this using JS or CSS. That the magic number of IE is 30 entries before
    the vertical scroll bar shows up.

    That's where I'm at right now. Can anyone help shed some light on this?


  2. Default Re: Controlling HTML SELECT vertical scroll bars

    Matthew Cox wrote:
    > The problem I'm trying to solve is that the designer would like
    > to limit the total number of entires shown when you click on
    > the drop-down arrow of a select box. I'm starting to think that
    > this isn't possible.


    You're right.


    PointedEars
    --
    Prototype.js was written by people who don't know javascript for people
    who don't know javascript. People who don't know javascript are not
    the best source of advice on designing systems that use javascript.
    -- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>

  3. Default Re: Controlling HTML SELECT vertical scroll bars

    Matthew Cox wrote:
    > Hi,
    >
    > I've been searching the net all day today trying to figure out how one
    > would accomplish what I originally thought would be a fairly straight
    > forward and simple thing. The problem I'm trying to solve is that the
    > designer would like to limit the total number of entires shown when
    > you click on the drop-down arrow of a select box. I'm starting to
    > think that this isn't possible.
    >
    > I've tried the following with no luck:
    >
    > - Setting the height attribute on the select element
    > - Setting a style height for the select attribute
    > - Modifying the same through Javascript
    > - Setting the style overflow-y to scroll
    > - Setting the size of the select element
    >
    > At some point in my browsing someone claimed that the vertical scroll
    > bars are controlled by the OS/Browser and there are no ways to change
    > this using JS or CSS. That the magic number of IE is 30 entries before
    > the vertical scroll bar shows up.
    >
    > That's where I'm at right now. Can anyone help shed some light on this?
    >


    You could change the dropdown to a non-dropdown select list of the size
    you want by adding a size="X" attribute to the select element (where X
    is the number of entries you want to show). Then you could show and
    hide that list using javascript on a button, and load the currently
    selected item into another element. Basically faking the whole
    interaction of the dropdown list.

    But you shouldn't. You have already put far too much work into this,
    and really it should be the designer's job to design around this
    limitation (rather than risking the breakage of functionality for some
    people just so your designer can have his way).

    Jeremy

  4. Default Re: Controlling HTML SELECT vertical scroll bars

    Thanks all for confirming.


  5. Default Re: Controlling HTML SELECT vertical scroll bars

    Hi Mathew,

    > I've been searching the net all day today trying to figure out how one
    > would accomplish what I originally thought would be a fairly straight
    > forward and simple thing.


    I agree that it should be straight-forward but, as you've discovered, sadly
    it isn't.

    FWIW, Here are a couple of examples of LOV size control that may or may not
    help with what you're trying to do: -

    http://manson.vistech.net/t3$examples/demo_client_web.html

    To see the example you will need:-

    1) Javascript enabled
    2) Java Applets enabled
    3) Can't be behind a Firewall that forbids all unknown outgoing connections
    (otherwise open-up 5255)
    4) Must be running SUN's JRE 1.4.2_13 or later (1.6 is advised)
    5) Must be running Internet Explorer (6 or later) or Firefox (Haven't tested
    other browsers)

    All things being equal you should then be prompted (via Java modal dialogue
    box) for:-

    Username: TIER3_DEMO
    Password: QUEUE

    Now enter an asterix "*" for the Queue Name and you will see the
    List-of-values appear with all the available queues on the Deathrow cluster.
    (This is one of those predictive text thingies that RobG says are humbug.
    "There should be a SUBMIT button in there God damn it!" :-) I have had to
    set the minimum size of the Select List to two (even if there is only one
    entry) this is because IE (at least) is crap and uses a seperate window for
    <select> lists. (Does it still do this with IE7?)

    Now click on the "Get Job Info" button and the list of available Jobs is
    returned. (Again, I grow the list to four entries then the scroll-bar
    diminishes and the "Jobs Found" field clicks over in real-time.)
    Unfortunately, setting "selectedIndex" disabled/enable and the timing of
    such is *critically* important for a pleasant sscreen appearance :-(

    Anyway, here is just one way of doing it. (Try clicking on the header row to
    see RobG's great idea for improving performance when tearing down select
    lists!) Drill down into detail by clicking on an option in the select list?)

    Cheers Richard Maher

    "Matthew Cox" <Matthew.A.Cox@gmail.com> wrote in message
    news:1190156212.717099.202880@50g2000hsm.googlegroups.com...
    > Hi,
    >
    > I've been searching the net all day today trying to figure out how one
    > would accomplish what I originally thought would be a fairly straight
    > forward and simple thing. The problem I'm trying to solve is that the
    > designer would like to limit the total number of entires shown when
    > you click on the drop-down arrow of a select box. I'm starting to
    > think that this isn't possible.
    >
    > I've tried the following with no luck:
    >
    > - Setting the height attribute on the select element
    > - Setting a style height for the select attribute
    > - Modifying the same through Javascript
    > - Setting the style overflow-y to scroll
    > - Setting the size of the select element
    >
    > At some point in my browsing someone claimed that the vertical scroll
    > bars are controlled by the OS/Browser and there are no ways to change
    > this using JS or CSS. That the magic number of IE is 30 entries before
    > the vertical scroll bar shows up.
    >
    > That's where I'm at right now. Can anyone help shed some light on this?
    >




+ Reply to Thread

Similar Threads

  1. scroll bars
    By Application Development in forum Javascript
    Replies: 6
    Last Post: 11-23-2007, 01:10 PM
  2. <Select> Vertical Scroll without index change
    By Application Development in forum Javascript
    Replies: 0
    Last Post: 08-21-2007, 03:09 PM
  3. Scroll bars don't cause validation
    By Application Development in forum DOTNET
    Replies: 0
    Last Post: 07-06-2007, 03:40 AM
  4. Scroll Bars
    By Application Development in forum basic.visual
    Replies: 8
    Last Post: 03-02-2005, 11:57 AM
  5. API and scroll bars
    By Application Development in forum basic.visual
    Replies: 1
    Last Post: 11-10-2003, 12:05 PM