2012-04-19 110 views
0

我有一個問題,而試圖用pluploadjQuery UI的對話框上傳。jQuery UI的對話框 - PLUPLOAD:Plupload不起作用第i個jQuery UI的對話框

我有一個模式對話框用jqueryui構建,我已經添加了一個plupload佈局。

但是,當我用Firefox試用它時,它打開我的2對話框 並與Safari它不起作用。

我看到生成的代碼,我已經看到,在Firefox我有2個

<div id="p16r5em3ep2gmrvk1ad335d1sae0_html5_container" style="position: absolute; background: none repeat scroll 0% 0% transparent; width: 0px; height: 0px; overflow: hidden; z-index: -1; opacity: 0; top: 0px; left: 0px;" class="plupload html5"> 
     <input type="file" multiple="multiple" accept="" style="font-size: 999px; position: absolute; width: 100%; height: 100%;" id="p16r5em3ep2gmrvk1ad335d1sae0_html5"> 
    </div> 

,第二個

<div id="p16r5em3i11ila2j0b91i163s44_html5_container" style="position: absolute; background: none repeat scroll 0% 0% transparent; width: 0px; height: 0px; overflow: hidden; z-index: -1; opacity: 0; top: 0px; left: 0px;" class="plupload html5"> 
     <input type="file" multiple="multiple" accept="" style="font-size: 999px; position: absolute; width: 100%; height: 100%;" id="p16r5em3i11ila2j0b91i163s44_html5"> 
    </div> 

對於Safari瀏覽器,我有...

<div id="p16r5fjomdg751e101jao122t12gd0_html5_container" style="position: absolute; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; overflow-x: hidden; overflow-y: hidden; opacity: 0; top: 0px; left: 0px; width: 0px; height: 0px; z-index: -1; background-position: initial initial; background-repeat: initial initial; " class="plupload html5"> 
    <input id="p16r5fjomdg751e101jao122t12gd0_html5" style="font-size: 999px; position: absolute; width: 100%; height: 100%; " type="file" accept="" multiple="multiple"> 
</div> 

而第二個

<div id="p16r5fjong1g231iqm10sq1jte1nc34_html5_container" style="position: absolute; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; overflow-x: hidden; overflow-y: hidden; opacity: 0; top: 0px; left: 0px; width: 0px; height: 0px; z-index: -1; background-position: initial initial; background-repeat: initial initial; " class="plupload html5"> 
     <input id="p16r5fjong1g231iqm10sq1jte1nc34_html5" style="font-size: 999px; position: absolute; width: 100%; height: 100%; " type="file" accept="" multiple="multiple"> 
</div> 

但沒有什麼是正確的。

注意,如果我不使用模式對話框,它的工作原理 ...

編輯 我使用此代碼初始化plupload

var uploader = new plupload.Uploader ({ 
     runtimes: 'html5,flash', 
     container:'container', 
     drop_element:'upDropArea', 
     browse_button: 'upBrowseButton', 
     url: 'url&action=action', 
     flash_swf_url: '/lib/plupload/js/plupload.flash.swf', 
     multipart: true, 
     urlstream_upload:true, 
     resize : {quality : 60}, 
     multiple_queues: true, 

     filters : [ 
        {title: 'Images', extensions: 'jpg,gif,png,jpeg'} 
     ] 


    }); 

任何想法?

感謝所有

+0

不確定actaull問題是什麼?什麼是代碼,什麼是錯誤?我的想法是壞了,但沒有足夠的信息來解決它。 – ppumkin 2012-04-19 16:18:38

+0

問題是我不能使用pluplad當我使用jQuery UI對話框與模態窗體。當我使用非模態的時候,它可以正常工作... – Sam 2012-04-19 19:07:52

+0

您可以添加用於初始化plupload的代碼嗎? – gonchuki 2012-04-20 00:56:40

回答

1

您不必初始化plupload構件到jQuery UI的模態對話框,當你在你的腳本intialize別的地方工作正常。

0

我已經最近通過在jQuery UI的對話框的「打開」功能回調編碼plupload對象實現在一個jQuery UI對話框pluploadQueue插件:

$("#plupload-dialog").dialog({ 
    autoOpen: false, 
    modal: false, // change this to true for modal, but haven't tested yet 
    open: function(event, ui) { 
     $("pluploader").pluploadQueue({ 
      runtimes: '', // add your runtimes here 
      url: '', // add your URL here 
      flash_swf_url: '', // path to shockwave component 
      silverlight_xap_url: '', // path to silverlight component 
      max_file_size: '', // file size option 
      filters: [], // filter options 
      preinit: { // preinit callbacks - note do not include separate init for pluploadQueue 
       Init: function(up, info) { 
       }, 
       UploadFile: function(up, file) { 
       }, 
       Error: function(up, args) { 
       } 
      } 
     }); 
    } 
}); 

不知道這是否會幫助,但也許值得一試。