您的位置:首页 > 产品设计 > UI/UE

easyui tab 加载iframe 高度问题(解决iframe右侧总出两个滚条方法)

2016-11-08 16:23 399 查看
问题描述:

浏览器兼容性导致右侧出现双滚动条。



html主要代码:

<div data-options="region:'center',border:false" style="background:#eee;">
<div id="tabsBar" class="easyui-tabs" fit="true">
</div>
</div>


js主要代码:

function addTabPage(tabName,tabUrl){
if($("#tabsBar").tabs("exists",tabName)){
$("#tabsBar").tabs("select",tabName);
}else{
$("#tabsBar").tabs("add",{
title:tabName,
content:'<iframe scrolling="auto" frameborder="0"  src="' + tabUrl
+ '" style="width:100%;height:100%;"></iframe>',
closable:true,
tools:[{
iconCls:"icon-mini-refresh",
handler:function(){
$('#tabsBar').tabs('getSelected').find("iframe")[0]
.contentWindow.location.reload(true);
}
}]
});
}
}


一、亲自验证方法(推荐):

解决iframe右侧总出两个滚条方法

#tabsBar .tabs-panels>.panel>.panel-body {
overflow: hidden;
}
二、源自网络解决方法:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


有其他更好的解决方法欢迎留言。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息