Welcome to WebmasterWorld Guest from 54.234.129.215

Forum Moderators: open

Message Too Old, No Replies

JQuery expanding the size of drop down list

JQuery expanding the size of drop down list

     

abidshahzad4u

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

5+ Year Member



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");
}
});

whoisgregg

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

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



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?

 

Featured Threads

Hot Threads This Week

Hot Threads This Month