手机浏览器上,上传按钮的几种变化
发布于 作者:苏南大叔 来源:程序如此灵动~
在移动互联网时代,传统的上传按钮,有了新的变化。点击后,可以调用相册,或者单独调用相机,或者录像等等。下面是几种变化,当然,并不是所有的手机浏览器都支持这几种属性,不过,这种情况在慢慢改善。相关文章:https://newsn.net/say/jquery_ajax_upload.html 。
<input type="file" accept="image/*" /> <!--正常单选-->
<input type="file" accept="image/*" capture="camera" /> <!--照相-->
<input type="file" accept="video/*" capture="camcorder" /><!--录像-->
<input type="file" accept="audio/*" capture="microphone" /><!--录音或照相-->
<input type="file" accept="image/*" multiple="multiple" /><!--多选-->
普通情况
<input type="file" accept="image/*" /> <!--正常单选-->
<input type="file" accept="image/*" multiple="multiple" /><!--多选-->
区别在于,图库是否可以多选。
只调用相片
<input type="file" accept="image/*" capture="camera" /> <!--照相-->
只调用录像
<input type="file" accept="video/*" capture="camcorder" /><!--录像-->
麦克风(录像或照片)
<input type="file" accept="audio/*" capture="microphone" /><!--录音或照相-->


