zoukankan
html css js c++ java
上传并查看图片
<!DOCTYPE html> <!-- saved from url=(0034)http://localhost:61694/Image/Index --> <html style="" class=" js flexbox flexboxlegacy canvas canvastext webgl no-touch geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers no-applicationcache svg inlinesvg smil svgclippaths"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <pre><code><meta name="viewport" content="width=device-width"> <title></title> <link href="./Index_files/bootstrap.css" rel="stylesheet"> </code></pre> <link href="./Index_files/site.css" rel="stylesheet"> <pre><code><script src="./Index_files/modernizr-2.8.3.js.下载"></script> </code></pre> </head> <body> <style> .must{ color:red; font-size:14px; } .userImg1{ 240px; height:135px; display: inline-block; background-color: #f3f5f4; text-align: center; line-height: 135px; vertical-align: top; margin-top:13px; margin-left:8px; cursor:pointer; } .userImg1{ background-size: 240px 135px; } .sub-btn{ 92px; height:35px; background-color: #e1251a; display: block; margin:25px 0 0 94px; border:none; outline: none; color:#fff; cursor:pointer; } input[type="file"] { display: none; } </style> <pre><code><div> <h1>图片选择</h1> <div class="userImg1" onclick="uploadFile('userImg1')" style="background-image: url("blob:http://localhost:61694/5f866f8a-7399-4b10-9870-74e34a237b49");">+添加图片</div> <input type="file" name="uploadImg1" display="none" class="fileBtn" accept="image/*" onchange="dofileBtn(this)"> </div> </code></pre> <script src="./Index_files/jquery-3.3.1.js.下载"></script> <script type="text/javascript"> var fileBtn = document.getElementsByClassName("fileBtn"); function dofileBtn(e) { const fileObj = e.files[0]; const windowURL = window.URL || window.webkitURL; if (fileBtn && fileObj) { const imgURL = window.URL.createObjectURL(fileObj); $(".userImg1").css("background-image", "url(" + imgURL + ")"); } } function uploadFile(e) { $(".fileBtn").click(); } $(".fileBtn").on("change", dofileBtn); </script> <pre><code></div> </code></pre> </body></html>
查看全文
相关阅读:
.NET Obfuscator Dotfuscator 入门
查询集合已修改;可能无法执行枚举操作
泛型(C# 2。0 编程指南) <一>
在服务器上部署VS 2008 ReportViewer,完美支持中文
dataGridView 闪烁 和 listview 闪烁 的解决办法。
Asp.Net 调试客户端脚本
疑是Microsoft Enterprise Library June 2005的一个小bug (续)
MagicAjax 0.30版的更新(翻译)
疑是Microsoft Enterprise Library June 2005的一个小bug
在web页面中水晶报表显示速度过慢的原因
原文地址:https://www.cnblogs.com/yyl001/p/15699687.html
最新文章
免费图标集合
C#编译时提示“GenerateResource”任务意外失败 解决方法!!!
C# 下面的代码示例演示如何结束异步操作以获取请求的流,然后开始一个请求以获取响应。....
.Net 程序完美加密工具: dotfuscator 下载及介绍
泛型(C# 编程指南)
泛型(C# 2。0 编程指南) <二>
datagridview .选择某个cell后在这个cell周围会出现一圈虚线, 如何清除??
强烈推荐:240多个jQuery插件
httpwebresponse 异步: request.BeginGetRequestStream 报错! 无法发送具有此谓词类型的内容正文。
有关异步HTTP的问题,就是在BeginGetResponse的时候出错,来看看。
热门文章
在Winform的DataGridView的单元格中同时显示文本和图标,以及树形结构的示例
ataTable 去除重复项 HOW TO: Implement a DataSet SELECT DISTINCT Helper Class in Visual C# .NET
繁體字 互转换 简体字
使用.NET访问 Internet(2)
C#自动登录DiscuzNT论坛并发帖
C# 抓取SSL加密的网页(https) 含证书验证
Dotfuscator Professional Edition 4.1 破解版
.Net 导出excel的若干种方法
HttpWebRequest使用注意(发生阻塞的解决办法)
c# 识别验证码
Copyright © 2011-2022 走看看