简体   繁体   English

当我单击图像/按钮时如何触发文件浏览

[英]how to trigger file browse when i click on image/button

I would like to trigger browsers file upload window when i click on custom button.Its should show same like below in the image. 当我点击自定义按钮时,我想触发浏览器的文件上传窗口,它应该显示如下图所示。 在此处输入图片说明

Take a look here: Custom file input can't be that hard? 在这里看看: 自定义文件输入不会那么难吗?

Or you can try something like this: 或者,您可以尝试执行以下操作:

<div style='width:140px;margin-top:80px;position:relative;'>
    <div style='position:absolute; cursor:pointer; cursor:hand; width:140px; height:20px; background:#3172a0; border-top:solid 1px #a2a2a2; color:#fff;padding-top:4px;' align='center'>Browse...</div>
        <input name='image' type='file' size='5' style='position:absolute; cursor:pointer; cursor:hand; height:25px; opacity:0.01; filter:alpha(opacity=0); top:0px; left:0px;' />
    </div>
</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM