Home  >  Article  >  Web Front-end  >  A brief analysis of IE10 compatibility issues (cols attribute of frameset)_javascript skills

A brief analysis of IE10 compatibility issues (cols attribute of frameset)_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:05:311238browse

Recent requirements involve browser compatibility, and the first one to deal with is ie10.

The homepage uses frameset to embed two pages. The left side is the menu bar, which can be shrunk by changing the cols of the frameset. Other browsers work fine, but IE10 has no response.

Copy code The code is as follows:

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

Setting cols has no effect, but setting rows can. This is due to a BUG problem in IE10, and the page size needs to be adjusted to take effect:
Copy code The code is as follows:

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

/*force ie10 redraw*/
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 = 'auto';
}, 0);
}
}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn