淺析IE10兼容性問題(frameset的cols屬性)
最近需求涉及瀏覽器的兼容性,首先處理的是ie10。
主頁用 frameset 嵌了兩個頁面,左側(cè)為菜單欄,可以通過改變 frameset 的 cols 來收縮。別的瀏覽器正常,但 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,*";
}
}
設置cols無效果,設置rows可以,這個是由于IE10的BUG問題,需要調(diào)整頁面大小才會生效:
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,*";
}
/*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);
}
}
相關文章
javascript實現(xiàn)獲取瀏覽器版本、操作系統(tǒng)類型
這篇文章主要給大家分享一段javascript實現(xiàn)獲取瀏覽器版本、操作系統(tǒng)類型的封裝好的代碼,使用非常方便,也很實用,推薦給大家。2015-01-01
JavaScript高級函數(shù)應用之分時函數(shù)實例分析
這篇文章主要介紹了JavaScript高級函數(shù)應用之分時函數(shù),結(jié)合實例形式分析了javascript通過合理分時函數(shù)應用避免瀏覽器卡頓或假死的相關操作技巧,需要的朋友可以參考下2018-08-08

