日期:2014-05-18 浏览次数:20440 次
var oReportDiv = $("div[id$=''oReportDiv'']"); var constheight = 15; oReportDiv.css("overflow", "hidden"); var innerDiv = $(oReportDiv).find("div").get(0); var table = $(oReportDiv).find("table").get(0); var tableHeight = $(table).attr("offsetHeight"); var tableDiv = $(table).find("div").get(0); var tableWidth = $($(tableDiv).find("table").get(0)).attr("offsetWidth"); $(innerDiv).css("height", tableHeight + constheight); $(innerDiv).css("width", tableWidth + constheight * 6);
var oReportDiv = $("[id$=oReportDiv]");
------解决方案--------------------
var oReportDiv = document.getElementById("<%=oReportDiv.ClientID%>") ;
------解决方案--------------------
都是一些简单的操作
test
var oReportDiv = document.getElementById("oReportDiv"); var constheight=15; oReportDiv.style.overflow="hidden"; var innerDiv = oReportDiv.getElementsByTagName("div")[0] var table = oReportDiv.getElementsByTagName("table")[0]; var tableHeight = table.offsetHeight; var tableDiv = table.getElementsByTagName("div")[0]; var tableWidth = tableDiv.getElementsByTagName("table")[0].offsetWidth; innerDiv.style.height=tableHeight+constheight; innerDiv.style.width = tableWidth+constheight*6
------解决方案--------------------