2010-05-18 3 views
0

아래 코드는 제 코드입니다.IE Z- 색인 버그 일 수 있습니까?

브라우저에서 페이지를 연 다음 div의 텍스트를 선택하면 텍스트가 일부 섀도우 쿼드 공백으로 표시됩니다. css 클래스 test1에서 z- 인덱스 : 0, 행을 삭제하면 ie가 올바르게 수행됩니다.

내 프로젝트에서 Z- 인덱스를 0보다 크게 설정해야 라인을 삭제할 수 없습니다.

해결책이 pannel.z-index가 0보다 큰 경우 bg_img.filter = ""를 설정하는 것으로 나타났습니다. 즉, 또한 잘 작동합니다. 그러나 불행히도 bg_img.filter.alpha도 설정해야합니다.

어떻게하면됩니까?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <script language="javascript" src="scripts/im_test.js"></script> 
    <title>test</title> 
    <style type="text/css"> 
     .test1 { 
     position:absolute; 
     background:#ffffff; 
     left:20px; 
     top:20px; 
     border:1px solid; 
     width:198px; 
     height:500px; 
     filter: progid:DXImageTransform.Microsoft.Shadow(color="#999999", Direction=135, Strength=5); 
     z-index:0; 
     } 
    </style> 
    <script> 

    function init() 
    { 
     var pannel = document.createElement ('div'); 
     var bg_img = document.createElement ('div'); 
     var head = document.createElement ('div'); 

     pannel.setAttribute('class', 'test1'); 
     pannel.setAttribute('className', 'test1'); 

     bg_img.style.cssText = "position:relative;left:0px;top:0px;" 
     + "width:198px;" 
     + "height:500px;" 
     + "filter:alpha(opacity=100);"; 

     head.style.cssText = "position:absolute;" 
     + "left:0px;" 
     + "top:0px;" 
     + "width:180px;" 
     + "height:20px;"; 

     document.body.appendChild (pannel); 
     pannel.appendChild(bg_img); 
     pannel.appendChild(head); 

     head.innerHTML = "<div>yusutechasdf</div><div>innerhtml</div>" 
    } 
    </script> 
    </head> 
    <body onload="init()"> 
    </body> 
</html> 

답변

0

IE가 z-index: 0; 문제가 하나에 설정을 시도하고 그에 따라 다른 Z-인덱스를 조정할 수 있습니다.