jQuery.selecteSizer - a fix for IE cutting off select dropdowns
Posted by stephen on October 23rd, 2008You may have seen this before…you have select dropdowns that are set to a certain width in accordance to the design. Anyone using IE will click the dropdown, and if any of the option items are wider than the select element’s width, they’re cutoff. This can be extremely hindering where you have a select dropdown of products or resources that all begin with the same ~20 characters. Some people just want to see the full option, too.
I’ve only found one, semi-elegant solution, and that is resizing the select container to “width:auto” on the focus event, and setting it back to its original size on the blur (unfocus) event. You also need to toggle the position to absolute and set its position so it shows up in the correct spot.
I created jQuery.selecteSizer to do this automatically on all specified selects.
Example Usage
if(j.browser.msie){
j("select").selecteSizer();
}
Recent Comments