...

View Full Version : picture display problem in iframe



Jian0203
03-28-2012, 03:54 AM
window.onload = function()
{
var vIframeUrl;
vIframeUrl= document.getElementById("ifrBDiagram").src;

if (vIframeUrl == "#" && document.getElementById("txtBnr").value == "")
{
document.getElementById("ifrBDiagram").src = "C://eBondingDiagram//Infineon.jpg";
}
getIframeSize();
}

function getIframeSize()
{
//Get window width and height
var winW = 630, winH = 460;
if (document.body && document.body.offsetWidth) {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
if (document.compatMode=='CSS1Compat' &&
document.documentElement &&
document.documentElement.offsetWidth ) {//alert("in 2");
winW = document.documentElement.offsetWidth;
winH = document.documentElement.offsetHeight;
}
if (window.innerWidth && window.innerHeight) {//alert("in 3");
winW = window.innerWidth;
winH = window.innerHeight;
}

document.getElementById("ifrBDiagram").width = (winW * 0.95);
document.getElementById("ifrBDiagram").height = (winH * 0.88);
}


<table width="100%" height="100%" bgcolor="#CAD4E3" align="center" valign="center" style="border: 5px solid;">
<tr>
<td><b>Bnr No:</b></td>
<td><input type="text" id="txtBnr" name="txtBnr" /></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><b>Lot No:</b></td>
<td><input type="text" id="txtLot" name="txtLot" /></td>
<td><INPUT id="btnCopy" TYPE="button" VALUE="Bonding Diagram" ONCLICK="fncCopy()">&nbsp;&nbsp;<INPUT id="btnUpdate" TYPE="button" VALUE="End Lot" ONCLICK="reloadPage()"></td>
<td> </td>
</tr>
<tr>
<td><b>Failure Catalogues:</b></td>
<td><select id="myList">
<option></option>
<option>DSO</option>
<option>Pre-Assembly</option>
<option>PO EOL</option>
<option>TDSON/TSDSON</option>
<option>S308/WISON</option>
</select>
</td>
<td><INPUT id="btnCata" TYPE="button" VALUE="Failure Catalogue" ONCLICK="fcnFailureCatalogue()"></td>
<td> </td>
</tr>
<tr>
<td colspan="4">
<iframe name="ifrBDiagram" id="ifrBDiagram" src=# style="border-width:4px; border-style:solid; border-color:blue;">
<span id="sMsg"></span>
</iframe>
</td>
</tr>
</table>

When I first run the html , the interface just goes like this.

http://img88.imageshack.us/img88/1042/error1j.png

After I press F5 to refresh the window, it displays this. The image just wont fit the iframe exactly.
http://img545.imageshack.us/img545/4050/error2ej.png

Can anyone please help to spot the bug ? I tried to use different resolution picture but still, the problem just doesn't solve. Is it really because of the image resolution ? Or something else gone wrong in my html ? Thanks :)

Old Pedant
03-28-2012, 04:06 AM
Are we supposed to guess what code is in getIframeSize()??

Jian0203
03-28-2012, 04:22 AM
Are we supposed to guess what code is in getIframeSize()??

Sorry, i missed out one part. Updated ~ :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum