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>
查看全文
相关阅读:
静态化之优化
SEO小技巧
apache 工具和简单优化
apache rewrite机制
nginx php win平台配置
mvc 简单模型
php无限分类三种方式
【转】sqlserver查询数据库中有多少个表
【转】sqlserver数据库之间的表的复制
SET ANSI_NULLS (TransactSQL)
原文地址:https://www.cnblogs.com/yyl001/p/15699687.html
最新文章
SQL汇总:mysql函数使用
2013过去一半的今天一点小惆怅
php开发环境配置及虚拟目录设置
SQL汇总:一条sql实现分条件count
使用HTML5的十大原因
SQL分批查询UNION与UNION ALL 使用技巧
在C#.Net 中调用SSIS 开发的Package,并用日志记录Package执行中的错误和异常信息
备份概念解析之backupset,backupmediaset,backupmediafamily(之一)
根据分隔符,拆分字符串tsql
在SQL Server 2005 中开启SSL(图文结合)
热门文章
SQL SERVER复制拓扑结构中,订阅端宕机后的处理.....(一)
SQLSERVER 2005启动失败(SQLBOOT.DLL丢失)
returned message "找不到可安装的 ISAM。".
Ad hoc 概念解释
SQL SERVER复制拓扑结构中,订阅端宕机后的处理.....(二)
添加 nolock 后速度慢了一倍有余
扩展 xp_fixeddrives
静态化技术实现方式
正则表达式 环视
全站静态化技术
Copyright © 2011-2022 走看看