2012-03-12 4 views
0

IEで選択したドロップダウンリストのコンテンツに直面しました。だから私は次のスクリプトを見つけた。そして私はtdに入れました。私はtdで特定の幅を設定しました。このスクリプトを置くと、幅が広がります。誰でも必要な助けをすることができます。他のスクリプトを提案する。ありがとうと私に教えてください。タグの幅の選択タグ

スクリプト:

$(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> 
+0

の幅を処理するために、次のコードを試してみてください、 DOMReadyで実行されているためです。 – karim79

+0

http://stackoverflow.com/questions/682764/select-dropdown-with-fixed-width-cutting-off-content-in-ieこちらに役立つ情報があるようです。それを超えて...あなたはここでは少しはっきりすることができる方法はありますか?あなたが求めていることは完全にはわかりません。 –

+0

私はこのスクリプトを使用しました:http://code.jquery.com/jquery-latest.min.js –

答えて

1

あなたはあなたの文書のHEADにあなたのJSを置くべき<select>

<select style="width:250px;" > 
+0

Shalini Subramani - 上記のコードを試しましたか? –