<script type="text/javascript" language="JavaScript">
function fixDiv()
{
var objLeft = document.getElementById('BigImgPic');
var objRight = document.getElementById('ContentPicInfo');
if (objLeft.offsetWidth != objRight.offsetWidth){
objRight.style.width = objLeft.offsetWidth + 'px';
}else{
objLeft.style.width = objRight.offsetWidth + 'px';
}
}
</script>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align=center><img id=BigImgPic src="pic/<%=res("pic2")%>"><br><%=res("shop_name")%>
<table id=ContentPicInfo border="0" cellpadding="0" cellspacing="0" width="100%" align=center>
<tr>
<td align=left><%=res("shop_name")%></td>
</tr>
</table>
如果在body里onload只能控制一个。但点下一个时就移位了。
我意思是想获取图片的宽。来定义下面表格的宽。也就是表格的内容同时与图片左对齐