⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 images.asp

📁 请认真阅读您的文件包然后写出其具体功能(至少要20个字)。尽量不要让站长把时间都花费在为您修正说明上。压缩包解压时不能有密码。
💻 ASP
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>插入图片</TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<link rel="stylesheet" type="text/css" href="editor.css">
<script language="JavaScript">
function checkchange()
{
	if (document.getElementById('chkSize').checked){
		document.getElementById('width').disabled=false;
		document.getElementById('height').disabled=false;
	}
	else{	
	   document.getElementById('width').disabled=true;
	   document.getElementById('height').disabled=true;
	   document.getElementById('width').value = "";
	   document.getElementById('height').value = "";
	   showimage();
	}
}

function showimage(){
	sFromUrl = document.getElementById('imgurl').value;
	sBorder = document.getElementById('border').value;
	sAlign = document.getElementById('aligntype').value;
	sWidth = document.getElementById('width').value;
	sHeight = document.getElementById('height').value;
	var sHTML = '<img src="'+sFromUrl+'" border="'+sBorder+'" align="'+sAlign+'"';
	if (sWidth!=""){
		sHTML=sHTML+' width="'+sWidth+'"';
	}
	if (sHeight!=""){
		sHTML=sHTML+' height="'+sHeight+'"';
	}
	sHTML = sHTML+' />';
	if (sFromUrl.length<10) sHTML='';
	document.getElementById('showimage').innerHTML = sHTML;
}

//Show/Hide a DIV
function showhidediv(id){
  try{
    var panel=document.getElementById(id);
	var urlPic=document.getElementById("urlPic");
    if(panel){
      if(panel.style.display=='none'){
        panel.style.display='block';
		urlPic.style.display='none';
      }else{
        panel.style.display='none';
		urlPic.style.display='block';
      }
	}
  }catch(e){}
}

function chkURL() {  
	var url = document.getElementById('imgurl').value; 
	if(url.indexOf( "/" )!=0 && url.indexOf( "http://" )!=0){
		url = "/"+url; 
	}
	document.getElementById('imgurl').value=url;  
	document.getElementById('imgurl').blur(); 
	return; 
}

function image(){
var imghtml="";
var sUrl = document.getElementById('imgurl').value;
var sAlign = document.getElementById('aligntype').value;
var sAltText = document.getElementById('alttext').value;
var sBorder = document.getElementById('border').value;
var bchkSize = document.getElementById('chkSize').checked;
var sWidth = document.getElementById('width').value;
var sHeight = document.getElementById('height').value;

if (sUrl=="" || sUrl=="http://") return;
sType=sUrl.substring(sUrl.length-3,sUrl.length).toLowerCase();
if (sType=="jpg" || sType=="gif"){
  imghtml += "<img src='"+sUrl+"' align='"+sAlign+"'";
  if (sAltText != "") imghtml += " alt='" + sAltText + "'";
  if (sBorder != "") imghtml += " border='" + sBorder + "'";
  if (bchkSize){
    if (sWidth != "") imghtml += " width='" + sWidth + "'";
	if (sHeight != "") imghtml += " height='" + sHeight + "'";
	}
  imghtml += ">";
  window.returnValue = imghtml;
  }
window.close();
}
</script>
</Head>

<BODY>
<table border="0" align="center" cellpadding="0" cellspacing="0" class="modeMain">
<tr>
<td>
<div class="topTitle" align=left><span style="cursor:pointer;" onClick="showhidediv('upPic')">插入图片</span></div>
<table id="urlPic" cellpadding="0" cellspacing="5" width="400" border="0" align="center">
  <tr> 
    <td height="20" align="right">URL</td>
    <td height="20" colspan="3" align="left"><input name="imgurl" type="text" id="imgurl" value="http://" size="48" onBlur="chkURL();showimage()" onKeyUp="showimage()"></td>
  </tr>
  <tr> 
    <td>&nbsp;</td>
    <td height="20" colspan="3" align="left"><iframe name="upfile" src="../upfile.asp?upValue=imgurl&amp;ismark=<%=cint(request("ismark"))%>&amp;ispre=<%=cint(request("ispre"))%>&amp;group=<%=cint(request("groups"))%>" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="no" style="width:100%;height:24px;"></iframe></td>
  </tr>
  <tr>
    <td align="right" width="15%">替换文字</td> 
    <td width="35%" height="30" align="left"><input name="alttext" type="text" id="alttext" size="18"></td>
    <td width="15%" align="right">对齐方式</td>
    <td width="35%" height="30"><select name="aligntype" id="aligntype" onChange="showimage();">
        <option value="" selected>默认</option>
        <option value="left">左对齐</option>
        <option value="right">右对齐</option>
        <option value="top">顶边对齐</option>
        <option value="texttop">文字上方</option>
        <option value="middle">相对垂直居中</option>
        <option value="absmiddle">绝对垂直居中</option>
        <option value="baseline">基线</option>
        <option value="bottom">相对底边对齐</option>
        <option value="absbottom">绝对底边对齐</option>
        <option value="center">居中</option>
      </select></td>
  </tr>
  <tr>
    <td align="right">图片大小</td> 
    <td height="30" align="left"><input name="chkSize" type="checkbox" id="chkSize" value="checkbox" onChange="checkchange();">
      <label for="chkSize">指定大小</label></td>
    <td align="right">边框粗细</td>
    <td height="30"><input name="border" type="text" id="border" value="0" size="5" onpaste="return !clipboardData.getData('text').match(/\D/)" onKeyPress="event.returnValue=(event.keyCode>=48)&&(event.keyCode<=57);">
      像素</td>
  </tr>
  <tr>
    <td align="right">宽</td> 
    <td height="30" align="left"><input name="width" type="text" id="width" size="5" onpaste="return !clipboardData.getData('text').match(/\D/)" onKeyPress="event.returnValue=(event.keyCode>=48)&&(event.keyCode<=57);" onChange="showimage();" disabled>
      像素 </td>
    <td align="right">高</td>
    <td><input name="height" type="text" id="height" size="5" onpaste="return !clipboardData.getData('text').match(/\D/)" onKeyPress="event.returnValue=(event.keyCode>=48)&&(event.keyCode<=57);" onChange="showimage();" disabled>
      像素</td>
  </tr>
  <tr>
    <td height="40" colspan="4" align="center"><input name="cmdOK" type="button" class="button" id="cmdOK" onClick="image();" value="确定"> 
      &nbsp;  <input name="close" type="button" class="button" id="close" onClick="window.close();" value="取消"></td>
  </tr>
</table>
</td>
</tr>
</table>
<table border="0" align="center" cellpadding="0" cellspacing="0" class="modeMain">
<tr>
<td>

	<div class="topTitle" align=left>图片预览</div>
	<table cellpadding="0" cellspacing="0" border="0" width="400">
		<tr>
			<td height="150" id="showimage"></td>
		</tr>
	</table>

</td>
</tr>
</table>
</BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -