Welcome to WebmasterWorld Guest from 107.22.55.73

Forum Moderators: open

Message Too Old, No Replies

JQuery expanding the size of drop down list

JQuery expanding the size of drop down list

     
7:05 pm on Nov 18, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:May 11, 2009
posts: 74
votes: 0


Hi to all

IE all versions are not displaying the drop down list correctly. The hide the text exceeding the select width. I have try to solve the problem with JQuery. The JQuery helped me lot but there is still an Issue. When the option text is greater than the select width, it expand. Great job. But when the all texts are less than the select width, select box is contracted to them. I want to stop the contraction. As I have to use this in multiple pages dynamically. code is as

$(document).ready(function(){
$("#dropdown").mousedown(function(){
if($.browser.msie) {
$(this).width("css","auto");
}
});
$("#dropdown").change(function(){
if ($.browser.msie) {
$(this).css("width","175px");

}
});
$("#dropdown").blur(function(){
if ($.browser.msie) {
$(this).css("width","175px");
}
});

8:22 pm on Dec 7, 2009 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member whoisgregg is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Dec 9, 2003
posts:3416
votes: 0


Trying to override the browsers' default behaviors with standard forum UI controls can be pretty maddening. Especially if you need to do so for multiple browsers.

Perhaps one of the IE min-width hacks out there could help sort this out?