87,907
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script>
function insertImage(){
document.getElementById('ifrm').src="D:\\402880c72b2354bc012b238d7ffe0010.bmp";
}
</script>
</HEAD>
<BODY>
<input type="button" name="button" value="测试" onclick="insertImage()"/>
<iframe id="ifrm" name="ifrm" scrolling="auto" width="100%" height="755" scrolling="auto" frameborder="0" border="0" marginwidth="0" marginheight="0" >
</BODY>
</HTML>
function showFile(FileID){
tmpLoad = false;
var fileFlag = FileID.IsPicture();
var oFrame = document.frames("frmMain").document.frames("middleMain").document.getElementById('threeMain');
//alert(oFrameBody.innerText);
if(fileFlag){
var oFrameBody = oFrame.contentWindow.document.body;
oFrameBody.innerHTML='';
//oFrameBody.innerText='';
//var document.frames("frmMain").document.frames("middleMain").document.getElementById('myImg').src="<%=basePath%>//scan//upload//"+FileID;
// var oFrame = document.frames("frmMain").document.frames("middleMain").document.getElementById('threeMain');
var oDiv = document.createElement("div");
oDiv.setAttribute("scrolling","true");
oDiv.setAttribute("width",oFrame.offsetWidth);
oDiv.setAttribute("heigth",755);
oDiv.setAttribute("style","color:red;border:2;overflow-y:scroll");
//oDiv.style.cssText="color:red;border:2;overflow-y:scroll;";
//var oDivd = document..createElement("div")
var oImg =document.createElement("img");
oImg.setAttribute("id","myimg");
oImg.src="<%=basePath%>//scan//upload//"+FileID;
oImg.onreadystatechange=function(){
if(oImg.readyState=="complete") {
if(oImg.width > oFrame.offsetWidth){
oImg.width = oFrame.offsetWidth-20;
}else{
oImg.width = oImg.width;
}
oImg.height = oImg.height;
//alert("oImg.width="+oImg.width+",oImg.length="+oImg.height);
oDiv.appendChild(oImg);
oFrameBody.appendChild(oDiv);
document.getElementById('btnRotation').disabled=false;
}
//alert("Frane高度--"+oFrame.offsetHeight+",Frane宽度--"+oFrame.offsetWidth+",oImg的宽度--"+oImg.height+",oImg的高度---"+oImg.width);
//oImg.height = oImg.height;
}
}else{
oFrame.location = "<%=basePath%>//scan//upload//"+FileID;
document.getElementById('btnRotation').disabled=true;
}
}
<SCRIPT language="javascript" type="text/javascript">
function fnApply(){
var oFrameBody = document.getElementById('frmMain');
var oContext = oFrameBody.contentWindow.document.body;
oContext.innerHTML = '';
//做一个div的框 目的是控制img对象
var oDiv = document.createElement("div");
oDiv.setAttribute("scrolling","true");
oDiv.setAttribute("width",500);
oDiv.setAttribute("heigth",600);
oDiv.setAttribute("style","color:red;border:2;overflow-y:scroll");
var oNewNode = document.createElement("img");
oNewNode.src = "D:\\Test\\05-src\\WebRoot\\scan\\upload\\402880c72b2448eb012b245ca191000c.jpg";
oNewNode.setAttribute("width","500");
oNewNode.setAttribute("height","700");
oDiv.appendChild(oNewNode);
oContext.appendChild(oDiv);
}
</SCRIPT>
<body>
<table width="100%" cellSpacing="0" cellPadding="0" border="0" id="tab">
<tr>
<td>
<iframe id="frmMain" name="frmMain" src="d:\\11.txt" width="500" height="600" id="ifrid" scrolling="auto" style= "border:1 solid #black" frameborder="0" > </iframe>
</td>
</tr>
</table>
<INPUT TYPE="button" VALUE="Apply Element" onclick="fnApply()">
</body>
function ReImgSize(obj){
var imgArr=document.getElementById(obj).getElementsByTagName("IMG");
for (i=0;i<imgArr.length;i++)
{
if (document.all)
{
if (imgArr[i].width>600)
{
imgArr[i].width="600"
imgArr[i].outerHTML='<a href="'+imgArr[i].src+'" target="_blank" title="在新窗口打开图片">'+imgArr[i].outerHTML+'</a>'
}
}
else
{
if (imgArr[i].width>600)
{
imgArr[i].title="在新窗口打开图片"
imgArr[i].style.cursor="pointer"
imgArr[i].onclick=function(e){window.open(this.src)}
}
}
}
}
ReImgSize("content");
//-->
</script>
<SCRIPT language="javascript" type="text/javascript">
function fnApply(){
var oFrameBody = document.getElementById('frmMain');
var oContext = oFrameBody.contentWindow.document.body;
oContext.innerHTML = '';
//做一个div的框 目的是控制img对象
var oDiv = document.createElement("div");
oDiv.setAttribute("scrolling","true");
oDiv.setAttribute("width",500);
oDiv.setAttribute("heigth",600);
oDiv.setAttribute("style","color:red;border:2;overflow-y:scroll");
var oNewNode = document.createElement("img");
oNewNode.src = "D:\\402880c72b2448eb012b245ca191000c.jpg";
oNewNode.setAttribute("width","500");
oNewNode.setAttribute("height","700");
oDiv.appendChild(oNewNode);
oContext.appendChild(oDiv);
}
</SCRIPT>
<body>
<table width="100%" cellSpacing="0" cellPadding="0" border="0" id="tab">
<tr>
<td>
<iframe id="frmMain" name="frmMain" src="d:\\11.txt" width="500" height="600" id="ifrid" scrolling="auto" style= "border:1 solid #black" frameborder="0" > </iframe>
</td>
</tr>
</table>
<INPUT TYPE="button" VALUE="Apply Element" onclick="fnApply()">
</body>