将图像预加载到精美的上传器用户界面中 [英] Preloading images into fine uploader UI

查看:73
本文介绍了将图像预加载到精美的上传器用户界面中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我一直在花时间让优秀的上载者从事一个正在开发的项目. 我可以将其与一些自定义的拖放顺序以及其他选项(例如删除)集成在一起,并将其集成到上载器的fileTemplate选项中.

Recently I've been spending time getting fine uploader to work on a developing project. I have it working with some custom drag n drop ordering and other options (such as delete) integrated into the fileTemplate option in fine uploader.

我想要实现的是,当用户编辑包含这些图像的数据时,这些图像已像上载图像时一样被预加载. 如此好地显示了所有图像都已上传之后的状态.

What I want to achieve is when a user edits their data that contains these images that they are preloaded as they were when the image where uploaded. So fine uploaded is displayed as it was after all the images had been uploaded.

但是,我在此上找不到任何文档或帮助.我最初的想法是在

However I cannot find any documentation or help on this. My initial conception was the output a duplicate of the fileTemplate code within the

<div id="fine-uploader"></div>

div. 但是,当上载初始化好后,它将删除代码.我不需要精美的上传器来初始化预加载的代码.只要我能使订单生效.

div. However when fine uploaded is initialized it removes the code. I do not need the preloaded code to be initalized by the fine uploader. Just as long as I can get the order working.

这肯定是实现此目的的一种方法吗?有人知道吗? 我能想到的唯一方法是在初始化完成后上传精美的JS. 但是我不是100%相信这将是一个顺利的过程.

Surely this must be a way to do this? Does any one know? The only way I can think of is to use funky JS after the fine uploaded as initialized. But I'm not 100% convinced it will be a smooth process.

推荐答案

通过简单地将HTML插入上载程序ul list元素中即可获得所需的结果.只是通过基本的jQuery. IE浏览器

The desired result was achieve by simply inserting the HTML into the fine uploader ul list element. Just by basic jquery. IE

$('ul', $('#fine-uploader')).html(preload);

此HTML是优良的成功者成功UI html的克隆.我不得不重新编写额外的脚本来处理我添加的一些额外功能,但最终考虑得很少.全部删除,拖动n放回所有正常工作.在多种浏览器中进行测试,尚未发现任何问题.到目前为止,我并不是喜欢用优雅的方式编写代码,但效果还不错.

This HTML being a clone of the fine uplaoder success UI html. I had to re-write extra script to handle some of the extra features I added but it ended up being minimal considering. All the delete, drag n drop re-ording all work fine. Testing in multiple browsers and have not found any issues yet. Not the elegant way I prefer to code but working quite well so far.

这篇关于将图像预加载到精美的上传器用户界面中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆