Home > Web Front-end > JS Tutorial > 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
Release: 2016-05-16 17:05:31
Original
1239 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template