以下は、ドロップダウンを取得し、そこからインライン幅スタイルを取得しようとしている jQuery のスニペットです。私の問題は、Safari IIで 225が得られないことです。newWidth
たとえばr_select
、Safari が Firefox とは異なる幅を返す理由がわかりません。
// get the current select box
targetSelect = $(this);
newWidth = parseInt(targetSelect.css('width'));
私のマークアップ:
<select name="r_select" id="r_select" style="width: 225px; height: 50px; float: left;">
<option>Mickelson</option>
<option>Montgomerie</option>
<option>Watson</option>
<option>Casey</option>
</select>
このドロップダウンで同じ問題が発生していないことを追加する必要があります。
<select id="r_select_overlay" class="r_select_overlay_test no_style" name="r_select_overlay" style="width: 145px; height: 50px; float:left;">
<option>Mickelson</option>
<option>Montgomerie</option>
<option>Watson</option>
<option>Casey</option>
</select>