dongse5408 2015-09-30 07:39
浏览 62

加载时PLupload图像顺序

First question here and I apologize in advance if my research wasnt thorough enough.

I am using PLupload to retrieve images from my server which it does fine, my problem is showing them in the order in which they were uploaded. The image order while retrieving is important as it is a fundamental part of the application.

Here is my code so far to retrieving:

ready: function() {
  plupload = $("#uploader").plupload('getUploader');    
  var files = new Array();
  $.get('data/funcs/retrieve.php', function(data) {
    <?php foreach($images as $key => $val){ ?>
      files.push('<?php echo $val; ?>');
    <?php } ?>

    files.forEach(function(entry) {
        var img = new mOxie.Image();
        var url = o.resolveUrl(entry);
            img.onload = function() {
                plupload.addFile(img.getAsBlob());
            } //end image onload
        img.load(url);
    });

    for(var i = 0, upPreviousSize = plupload.files.length - files.length, size = files.length; i < size; i++) {
      files[i]["initialIndex"] = (i + upPreviousSize) * -1;
    }       
}); 

Any help will be greatly appreciated.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 运筹学排序问题中的在线排序
    • ¥15 关于#flink#的问题:关于docker部署flink集成hadoop的yarn,请教个问题flink启动yarn-session.sh连不上hadoop
    • ¥30 求一段fortran代码用IVF编译运行的结果
    • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
    • ¥15 lammps拉伸应力应变曲线分析
    • ¥15 C++ 头文件/宏冲突问题解决
    • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
    • ¥50 安卓adb backup备份子用户应用数据失败
    • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
    • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题