2011-11-09 58 views
0

我使用這個模塊:http://digitarald.de/project/fancyupload/使用花式上傳,試圖觸發文件瀏覽器

比方說我的初始化代碼如下:

this.uploader = new FancyUpload2(this.uploader_element, this.list, { 
     limitSize: _config.upload_max_filesize, 
     verbose: false, 

     url: this.form.action, 

     path: this.options.root_dir + 'libraries/fancyupload/source/Swiff.Uploader.swf', 

     typeFilter: { 
      //'Images (*.jpg, *.jpeg, *.gif, *.png)': '*.jpg; *.jpeg; *.gif; *.png' 
     }, 

     target: 'assets-browse', 

這是可能調用打開瀏覽窗口,同當我按ID與'資產 - 瀏覽'的元素?我嘗試了$('assets-browse')。call('click')沒有運氣。

+0

嘗試'.fireEvent(「點擊」)'或'甚至fileinputel.focus()'作爲文件輸入,通常由焦點開始,不要點擊 - 取決於事件的抽象是怎麼做的。 –

回答

0

您可以通過opener調用打開窗口的功能。使用它像parent

<script type="text/javascript"> 
    window.opener.foo(); 
</script>