【问题标题】:jquery colorbox not loading iframe contentjquery colorbox不加载iframe内容
【发布时间】:2011-11-04 07:17:29
【问题描述】:

我被困在我的网站上的某个地方:http://clients.arkamatics.com/signature/ 我正在使用 colorbox 和其他一些插件,比如 uploadify 和 colorpicker,当我在本地 xampp 服务器上检查代码时,代码对我来说很好,但是一旦我上传到网上,colorbox没有加载iframe和内容,接下来你可以执行以下步骤:

  1. 打开网站:http://clients.arkamatics.com/signature/
  2. 左下角有一个上传按钮,点击上传文件,
  3. 在上传完成过程中,警报(这是我们调试的一部分)将显示我们传递给 colorbox 以在 iframe 中打开的 URL。
  4. 颜色框打开但只显示一个加载图标,不会在 iframe 中加载 url 内容,下面是我用来做同样事情的代码集:

    $("#fileUpload").fileUpload({
    'uploader': 'uploadify/uploader.swf',
    'cancelImg': 'uploadify/cancel.png',
    'script': 'uploadify/upload.php',
    'folder': '/images',
    'multi': false,
    'displayData': 'speed',
    'auto'      : true,
    'buttonImg' : 'uploadify/btnupload.png',
    'wmode' : 'transparent',
    'onComplete'  : function(event, ID, fileObj, response, data) {
        //alert('There are ' + fileObj.name + ' files remaining in the queue.'+fileObj.type);
        //$(".img_tpl").load('uploadedimage.php?filename='+fileObj.name);
        var filename = fileObj.name.replace(/ /g,"_"); 
        var colboxurl = 'upload1/uploadedimage.php?filename='+filename;
        alert(colboxurl);
        $.fn.colorbox({iframe: true, href:colboxurl, width:"90%", height:"90%",onClosed:function(){ 
                        $(".img_tpl").load('upload1/showfinalimage.php?filename='+filename,function(){   
                                                    $(".file_name").val($(".img_tpl img").attr('src'));
                                                    $(".remove_img").show();
                                                    adjustheights();
                                                })
    
        }});
    }
    });
    

任何帮助将不胜感激。

【问题讨论】:

    标签: jquery uploadify colorbox


    【解决方案1】:

    某些颜色框或灯箱无法像个人一样打开我研究了许多插件,但没有一个能起作用,因为它们在加载它们时会作为动态链接。所以最好使用这里的jquery image gallery plugin,一切正常。

    http://blueimp.github.com/jQuery-Image-Gallery/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多