62,254
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>图片预览效果</title>
<script language="javascript" type="text/javascript" src="../Js/CJL.0.1.min.js"></script>
<script language="javascript" type="text/javascript" src="../Js/QuickUpload.js"></script>
<script language="javascript" type="text/javascript" src="../js/ImagePreviewd.js"></script>
</head>
<body>
<style>
.perview {width:600px;background:#fff;font-size:12px; border-collapse:collapse;}
.perview td, .perview th {padding:5px;border:1px solid #ccc;}
.perview th {background-color:#f0f0f0; height:20px;}
.perview a:link, .perview a:visited, .perview a:hover, .perview a:active {color:#00F;}
.perview table{ width:100%;border-collapse:collapse;}
</style>
<table border="0" class="perview">
<tr>
<th>选择文件</th>
<th width="50%">预览图</th>
</tr>
<tr>
<td height="200"><input id="idFile" name="pic" type="file" /></td>
<td align="center"><img id="idImg" /></td>
</tr>
</tbody>
</table>
<script>
var ip = new ImagePreview( $$("idFile"), $$("idImg"), {
maxWidth: 200, maxHeight: 200, action: "ImagePreview.ashx"
});
ip.img.src = ImagePreview.TRANSPARENT;
ip.file.onchange = function(){ ip.preview(); };
</script>
/body>
</html>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AddFloor.aspx.cs" Inherits="Manage_Floor_AddFloor" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="../Css/Base.css" rel="stylesheet" type="text/css" />
<link href="../Css/main.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="../Js/CJL.0.1.min.js"></script>
<script language="javascript" type="text/javascript" src="../Js/QuickUpload.js"></script>
<script language="javascript" type="text/javascript" src="../js/ImagePreviewd.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div class="users">
<dl>
<dt>添加荣誉信息</dt>
<dt><a href="FloorManage.aspx">管理荣誉信息</a></dt>
</dl>
</div>
<div>
<table width="914" height="100" border="0">
<tr>
<td width="99" height="25">标题:</td>
<td width="513" align="left"><asp:TextBox ID="txtTitle" runat="server" Width="300px"></asp:TextBox></td>
<td align="center" rowspan="3" width="513">
<b>图片预览</b><br />
<asp:Image ID="idImg" runat="server" Width="200" Height="200"/></td>
</tr>
<tr>
<td style="height: 25px">上传图片:</td>
<td align="left" style="height: 29px"><asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Label ID="Label1" runat="server" Text="上传的图片大小不能超过2兆" ForeColor="red"></asp:Label>
</td>
</tr>
<tr>
<td style="height: 24px"> </td>
<td align="left" style="height: 24px"> <asp:Button ID="btnaddd" runat="server" Text="添加" OnClick="btnaddd_Click" />
<input type="reset" name="Submit2" value="重置" />
<asp:Label ID="lb" runat="server" Text="" ForeColor="red"></asp:Label></td>
</tr>
</table>
<script>
var ip = new ImagePreview( $$("FileUpload1"), $$("idImg"), {
maxWidth: 200, maxHeight: 200, action: "ImagePreview.ashx"
});
ip.img.src = ImagePreview.TRANSPARENT;
ip.file.onchange = function(){ ip.preview();};
</script>
</div>
</form>
</body>
</html>