2011-11-04 78 views
0

我被困在我的網站上的一個點上:http://clients.arkamatics.com/signature/我在其他插件上使用colorbox,比如uploadify和colorpicker,當我在本地xampp服務器上檢查它時,代碼正常工作,但一旦我上傳在網上的顏色框沒有加載iframe和內容,按照您可以執行以下步驟:jquery colorbox not loading iframe content

  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(); 
                  }) 
    
        }}); 
    } 
    }); 
    

任何幫助將不勝感激。

回答

0

某些colorbox或Lightbox不能打開,因爲我個人研究了很多插件,但都沒有工作,因爲它們在加載它們時作爲動態鏈接。更好的方法是使用這裏的jquery image gallery plugin,並且一切正常。

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