>  기사  >  웹 프론트엔드  >  IE10 호환성 문제에 대한 간략한 분석(프레임셋의 cols 속성)_javascript 기술

IE10 호환성 문제에 대한 간략한 분석(프레임셋의 cols 속성)_javascript 기술

WBOY
WBOY원래의
2016-05-16 17:05:311195검색

최근 요구 사항은 브라우저 호환성과 관련이 있으며, 가장 먼저 처리해야 할 요구 사항은 ie10입니다.

홈페이지에서는 프레임셋을 사용하여 두 페이지를 삽입합니다. 왼쪽에는 프레임셋의 열을 변경하여 축소할 수 있는 메뉴 표시줄이 있습니다. 다른 브라우저는 잘 작동하는데 IE10에서는 응답이 없습니다.

코드 복사 코드는 다음과 같습니다.

function hide_show(){
if (window.parent.outer_frame.cols=="0,10,*"){
frameshow.src="<%=request.getContextPath()%>/common/images/left_handle.gif";
div_hide_show .title="숨기기"
window.parent.outer_frame.cols = "210,10,*";
}else{
frameshow.src="<%=request.getContextPath( )%> ;/common/images/right_handle.gif";
div_hide_show.title="표시"
window.parent.outer_frame.cols = "0,10,*";
}
}

열 설정은 효과가 없지만 행 설정은 가능합니다. 이는 IE10의 BUG 문제로 인한 것이며, 이를 적용하려면 페이지 크기를 조정해야 합니다.
코드 복사 코드는 다음과 같습니다.

function hide_show(){
if(window.parent.outer_frame. cols=="0,10,*"){
frameshow.src="<%=request.getContextPath()%>/common/images/left_handle.gif";
div_hide_show.title=" 숨기기"
window.parent.outer_frame.cols = " 210,10,*";
}else{
frameshow.src="<%=request.getContextPath()%>/common/ Images/right_handle.gif";
div_hide_show.title= "표시"
window.parent.outer_frame.cols = "0,10,*";
}

/*ie10 다시 그리기 강제*/
if(navigator.userAgent.indexOf('MSIE 10.0') != -1){
var w = parent.document.body.clientWidth;
parent .document.body.style.width = w 1 'px';
setTimeout(function(){
parent.document.body.style.width = w - 1 'px';
parent.document .body.style.width = '자동';
}, 0);
}
}

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.