jQuery File Upload预览图

编程入门 行业动态 更新时间:2024-10-11 19:20:30
本文介绍了jQuery File Upload预览图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用jQuery File Upload插件( blueimp.github.io/jQuery-File-Upload/)上传图片到我的网站.我已经浏览过( github/blueimp/jQuery-File-Upload/wiki/Options ),但我没有找到分配用于显示图像的元素的设置.那么,如何使用此插件在网页上预览图像?

I am using jQuery File Upload plugin (blueimp.github.io/jQuery-File-Upload/) for image upload for my website. I have look through (github/blueimp/jQuery-File-Upload/wiki/Options), but I didn't find the setting to assign an element to display the image. So, how can I preview the image on the webpage with this plugin?

谢谢.

推荐答案

我认为Jquery File Upload插件不提供预览功能.

I don't think that the Jquery File Upload plugin provides preview functionality.

但是您可以轻松地将其实现到插件的添加选项中:

But you can easily implement it into the plugin's add option:

add: function (e, data) { if (data.files && data.files[0]) { var reader = new FileReader(); reader.onload = function(e) { $('#target').attr('src', e.target.result); } reader.readAsDataURL(data.files[0]); ... data.submit(); } }

没有BlueImp插件的实时示例.

更多推荐

jQuery File Upload预览图

本文发布于:2023-10-10 22:22:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1479917.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:jQuery   File   Upload

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!