<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BuildingMore.aspx.cs" Inherits="Web_MoreInfos_BuildingMore" %><!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">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style=" height:100%">
<tr style=" height:1000px;">
<td style=" width:100%;height:100%;">
<object data="data:application/x-silverlight-2,"
type="application/x-silverlight-2" width="100%" style="height:100%;">
<param name="source" value="../../ClientBin/MyCharts.xap"/>
<param name="initparams" value="ChartType=BuildingModel1" />
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="4.0.60310.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.60310.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="获取 Microsoft Silverlight" style="border-style:none"/>
</a>
</object>
</td>
</tr>
</table>
</form>
</body>
</html>问题:“Object”的高度设为“100%”了,但是并没有根据“<tr style=" height:1000px;">”设置的“1000px”的高度来显示,为什么呢??? “Object”引用的元素的高度是“100%”的,可以根据屏幕全屏显示的。 PS: "Object"引用的“Silverlight页面”不论任何分辨率,都可以根据屏幕全屏显示。也就是说不论“Td”单元格的“高度和宽度”是多少,“Object”中的“Silverlight页面“都可以撑满单元格“Td”。
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style=" height:100%">
<tr style=" height:1000px;">
<td style=" width:100%;height:100%;">
<object data="data:application/x-silverlight-2,"
type="application/x-silverlight-2" width="100%" style="height:100%;">
<param name="source" value="../../ClientBin/MyCharts.xap"/>
<param name="initparams" value="ChartType=BuildingModel1" />
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="4.0.60310.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.60310.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="获取 Microsoft Silverlight" style="border-style:none"/>
</a>
</object>
</td>
</tr>
</table>
</form>
</body>
</html>问题:“Object”的高度设为“100%”了,但是并没有根据“<tr style=" height:1000px;">”设置的“1000px”的高度来显示,为什么呢??? “Object”引用的元素的高度是“100%”的,可以根据屏幕全屏显示的。 PS: "Object"引用的“Silverlight页面”不论任何分辨率,都可以根据屏幕全屏显示。也就是说不论“Td”单元格的“高度和宽度”是多少,“Object”中的“Silverlight页面“都可以撑满单元格“Td”。
如果可以,再研究下TD的问题。有的时候高度用百分比是会出现问题的。
二:$("#table1").height($("body").height(););//table高度等于body的高度,也就是窗体的高度。
以此类推。$(function(){$("#table1").height($("body").height(););})
需要设置百分比 需要 css: html,body{height:100%}
编写窗口的resize事件,用JS控制元素的height