簡體   English   中英

為什么IE7和IE8卻說它沒有“ hasLayout”?

[英]Why is IE7 & IE8 says that it 'hasLayout', when it doesn't?

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;}

Java腳本

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

jsbin jsfiddle

因為不透明度不起作用,所以我應該在控制台中(對於IE7&8)得到“ false”,但結果是“ true”

元素是否確實具有“ hasLayout”功能,但不透明度由於其他原因而無法正常工作?

盡管我對此表示懷疑,因為甚至連jQuery都無法設置不透明度。

看起來所有“表”元素默認都具有hasLayout===true tropacity不起作用,因為您需要為td定義opacity

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM