2014-03-05 193 views
0

單擊上傳按鈕後,我想要顯示img.png。下面是按鈕的代碼:我想隱藏它時,文件名的值來的IFRAME按鈕上顯示圖像單擊並隱藏iframe加載時

<button style="padding: 4px;margin-top: 30px;border-radius: 0px;" type="submit" class="btn btn-primary btn-lg"><span class="glyphicon glyphicon-upload"></span></button> 
<div id="image_details"></div> 

。文件上傳代碼如下。

<form target="upload_target" id="fileupload" method="post" action="<?php echo site_url('upload_file/upload_it'); ?>" enctype="multipart/form-data"> 

<div class="fileUpload btn btn-warning"> 
    <span>Browse</span> 
     <input id="uploadBtn" type="file" multiple="multiple" name="files[]" class="upload" /> 
</div> 
<input id="uploadFile" style="width: 160px; margin-top: 30px;float: left;height: 34px;" placeholder="Choose File" disabled="disabled" /> 
<button style="padding: 4px;margin-top: 30px;border-radius: 0px;" type="submit" class="btn btn-primary btn-lg"><span class="glyphicon glyphicon-upload"></span></button> 
<div id="image_details"></div> 
</form> 
</div> 
    </div> 
<div class="col-lg-3" style="padding-left:0px;"> 
<iframe id="upload_target" name="upload_target" src="#" style="border:0px; background-color:#FFFFFF; " scrolling="no"> 
      </iframe>     
</div> 
+0

感謝所有的更正。 – BinteHava

回答

0
使用jQuery

,你應該增加兩個事件:

$("#fileupload").on("submit", function() 
    { 
    //Put here the code to SHOW image 
    }); 

$("#upload_target").on("load", function() 
    { 
    //Put here the code to HIDE image 
    }); 
+0

隨着一點點變化它的工作原理我只是把按鈕點擊內的加載事件。感謝您分享您的想法。 – BinteHava