0

I faced select drop down list content cutting off in IE. So I found following script. And I have placed in td. I have set particular width in td. If I place this script my td width will expand. Anyone can help needful. Or Suggest any other script.

Script:

$(document).ready(function() {
                if ($.browser.msie) $('select.wide')
                    .bind('focus mouseover', function() { $(this).addClass('expand').removeClass('clicked'); })
                    .bind('click', function() { $(this).toggleClass('clicked'); })
                    .bind('mouseout', function() { if (!$(this).hasClass('clicked')) { $(this).removeClass('expand'); }})
                    .bind('blur', function() { $(this).removeClass('expand clicked'); });

            });

HTML:

<table width="300" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="40" style="overflow:hidden;">   <select class="wide">
            <option>Lorem ipsum dolor sit amet</option>
            <option>consectetur adipiscing elit</option>
            <option>Etiam elementum</option>
            <option>a arcu</option>
            <option>fringilla eu malesuada </option>
            <option>quam scelerisque</option>
            <option>Curabitur ut nisi neque</option>
    </select></td>
    <td>sasd</td>
  </tr>
</table>
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Shalini Subramani
  • 502
  • 1
  • 6
  • 23
  • You should place your JS in the HEAD of your document, since it is being executed on DOMReady. – karim79 Mar 12 '12 at 13:44
  • http://stackoverflow.com/questions/682764/select-dropdown-with-fixed-width-cutting-off-content-in-ie looks like it has some stuff that you might find helpful here. Beyond that... is there any way you could be a bit clearer here? I'm not entirely sure what you're asking for. – Ben Barden Mar 12 '12 at 13:45
  • I have used this script: http://code.jquery.com/jquery-latest.min.js – Shalini Subramani Mar 12 '12 at 13:45
  • overflow:hidden is causing problems likely – charlietfl Mar 12 '12 at 13:51

1 Answers1

1

Try the following code to handle the width of <select>

<select style="width:250px;" >
Arun Singh
  • 1,538
  • 4
  • 19
  • 43