2016-05-19 17 views
0
<td class="ADDDLFFForm2" colspan="5"> 
    <div> 
     <select style="width: 91px; display: none;"> 
      <span id="" class="selectboxit selectboxit-enabled selectboxit-btn" style="width: 95px;"> 
       <span class="selectboxit-option-icon-container" style="width: 95px;"> 
        <i id=""></i> 
       </span> 
       <span id="" class="selectboxit-text" unselectable="on" data-val="1" aria-live="polite" style="max-width: 79px;"> 
        Deutsch 
       </span> 
       <span id="" class="selectboxit-arrow-container" unselectable="on"> 
        <i id="" class="selectboxit-arrow selectboxit-default-arrow" unselectable="on"></i> 
       </span> 
      </span> 
      <ul class="selectboxit-options selectboxit-list" tabindex="-1" role="listbox" aria-hidden="true" style="min-width: 109px;"> 
       <li data-id="0" data-val="1" data-disabled="false" class="selectboxit-option selectboxit-option-first selectboxit-selected" data-icon="/WikiNotificationMails - Copy/Base/Untitled/Image.ashx?" role="option"> 
        <a class="selectboxit-option-anchor"> 
         <span class="selectboxit-option-icon-container" style="width: 95px;"> 
          <i></i> 
         </span> 

select要素幅をspan class="selectboxit selectboxit-enabled selectboxit-btn"幅と同じに設定します。これどうやってするの?設定方法jqueryを使用して要素の幅をspan要素に選択しますか?

+0

ご質問は明確ではありません。すぐに助けを得ることができるように、[help](http://stackoverflow.com/help/mcve)を参照して正しく質問してください。 – Shrabanee

+0

あなたのHTMLは間違っています。 'option'や' optgroup'以外の 'select'の中に要素を持つことはできません。 –

答えて

0

これを試してみてください:

var width = $(".selectboxit-enabled").css("width"); //First get the width of span with class selectboxit-enabled 

$("select").css("width",width); // then set that width to select 
+0

私はOPがこれを逆にしたいと思う。 –

+0

私は彼が選択ボックスにスパンの幅を設定したいと思うと思いますか? –

+0

彼はpreviosの内容に賛成しているので、selectboxの幅をspanに設定したいようですが、今質問の内容が変更されています –

関連する問題