0

HTML:

  <div class="table" >
      <div class="row" >
        <span>Tb with DIV</span> <span>col2</span> <span>col3</span>
      </div>
        <div class="row" >
        <span>col1</span> <span>col2 test</span> <span>col3</span>
      </div>
        <div class="row" > <span>col1</span> <span>col2</span> <span>col3 test</span>
      </div>
    </div>

    <table>
      <tr id="testRow">
        <td>Tb with <'table'></td> <td>col2</td> <td>col3</td>
      </tr>
      <tr >
        <td>col1</td> <td>col2 test</td> <td>col3</td>
      </tr>
      <tr >
        <td>col1</td> <td>col2</td> <td>col3 test</td>
      </tr>
    </table>

CSS:

.table, table {
    display:table; 
        /*
        width:200px; 
        height:100px;
        zoom:1;
        */
        }
.row  { display:table-row; }
.row, tr {
        width:200px !important;
        min-height:1px !important;
        zoom:1;
        white-space:nowrap;

   -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
    filter: alpha(opacity=20);
    -moz-opacity:0.2;
    -khtml-opacity: 0.2;
    opacity: 0.2;
}
.row span, td {display:table-cell;padding: 5px;}

Javascript

$(function () { 
    console.log (document.getElementById('testRow2').currentStyle.hasLayout);
    //$('.row, tr').fadeTo('fast',0.2);
});

jsbin jsfiddle

不透明度が機能していないため、コンソールで「false」を取得する必要があります (IE7&8 の場合) が、結果は「true」です。

要素は本当に「hasLayout」ですが、他の理由で不透明度が機能していませんか?

jQueryでさえ不透明度を設定できないので、私はそれを疑います。

4

1 に答える 1

0

Looks like all "table" elements have hasLayout===true by default. The opacity for tr is not working, since you need to define opacity for td instead.

于 2013-09-04T06:21:24.063 に答える