如何设置telerik radtabstrip高度为auto。
我希望随着内容大小的增加而增加标签的高度。 我不想要滚动条。我已经搜索了但它只需要固定大小
答案 0 :(得分:1)
如果你在谈论PageView的高度:
ASPX:
<telerik:radtabstrip id="RadTabStrip1" runat="server" selectedindex="0" multipageid="RadMultipage1">
<Tabs>
<telerik:RadTab Text="Tab1" PageViewID=" RadMultipage1">
</telerik:RadTab>
<telerik:RadTab Text="Tab2">
</telerik:RadTab>
<telerik:RadTab Text="Tab3">
</telerik:RadTab>
</Tabs>
</telerik:radtabstrip>
<telerik:radmultipage id="RadMultipage1" runat="server" selectedindex="0">
<telerik:RadPageView runat="server" ID="RadPageView1" ContentUrl="Default2.aspx" />
</telerik:radmultipage>
JavaScript的:
<script type="text/javascript">
function resize() {
var height = getDocHeight();
var elements = window.top.document.getElementsByTagName("div");
for (var i = 0; i < elements.length; i++) {
var containerPageViewID = "RadPageView1";
if (elements[i].id.indexOf(containerPageViewID) > -1) {
elements[i].style.height = height + "px";
break;
}
}
}
if (window.addEventListener)
window.addEventListener("load", resize, false);
else if (window.attachEvent)
window.attachEvent("onload", resize);
else window.onload = resize;
function getDocHeight() {
var D = document;
return Math.max(
Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
Math.max(D.body.clientHeight, D.documentElement.clientHeight)
);
}
</script>