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+.
That's pretty spifferrific there Vladdy! :thumbsup:
Re: ListBox upgrade
I $$$$uppose ;)
That is a nice script Vladdy :thumbsup:
I have seen a similar function in windows that works the same, and it is very useful.
|All times are GMT +1. The time now is 07:08 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.