Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: ListBox upgrade

  1. #1
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ListBox upgrade

    Someone on another forum was complaining about the inability of listbox to scroll horizontally and view long items, so I whipped up a little demo that replaces select elements (with size set to 2+) with a div element and hidden input element thus emulating the listbox control.
    The code is IE only, but can easily be modified for Gecko compliance by rewriting event related routines.
    The beauty of the approach is that in antique (NS4.*) and wannabe (Opera) browsers and others with JS disabled the select element is still there, so usability is not impacted at all.
    In a div element that replaces the listbox all styles are customizable. Tooltips are implemented for items that exceed the box width.
    The code can also be extended to include OPTGROUP recognition thus making the emulation complete.
    It will also solve the problem with the IE bug that renders listboxes (and other controls) above everything, regardless of z-index setting.
    The code was tested only in IE6.0 (I said, it's something I wipped up over the lunch hour) but should work with IE 5+.
    Enjoy.

    http://www.vladdy.net/tests/lbie.html
    Last edited by Vladdy; 02-08-2003 at 01:01 AM.
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That's pretty spifferrific there Vladdy!
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #3
    New to the CF scene
    Join Date
    Aug 2003
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ListBox upgrade

    can one do it for a combo box? I posted a query in the JavaScript forums


    Originally posted by Vladdy
    Someone on another forum was complaining about the inability of listbox to scroll horizontally and view long items, so I whipped up a little demo that replaces select elements (with size set to 2+) with a div element and hidden input element thus emulating the listbox control.
    The code is IE only, but can easily be modified for Gecko compliance by rewriting event related routines.
    The beauty of the approach is that in antique (NS4.*) and wannabe (Opera) browsers and others with JS disabled the select element is still there, so usability is not impacted at all.
    In a div element that replaces the listbox all styles are customizable. Tooltips are implemented for items that exceed the box width.
    The code can also be extended to include OPTGROUP recognition thus making the emulation complete.
    It will also solve the problem with the IE bug that renders listboxes (and other controls) above everything, regardless of z-index setting.
    The code was tested only in IE6.0 (I said, it's something I wipped up over the lunch hour) but should work with IE 5+.
    Enjoy.

    http://www.vladdy.net/tests/lbie.html

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I $$$$uppose
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #5
    Regular Coder
    Join Date
    Mar 2003
    Posts
    241
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That is a nice script Vladdy

    I have seen a similar function in windows that works the same, and it is very useful.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •