顯示進度條這是我的代碼:如何上傳圖片時,在PHP
$(function(){
var btnUpload=$('#browse');
var adinfoid=$('#adinfoid').val();
new AjaxUpload(btnUpload, {
action: '<?php echo base_url()?>index.php/post/upload_editmainimage/'+adinfoid,
name: 'uploadfile',
onSubmit: function(file, ext){
$("#progressid").css("display","block");
if (! (ext && /^(jpg|png|jpeg|gif|JPG|PNG|JPEG|GIF)$/.test(ext))){
$("#mainphotoerror").html('Only JPG, PNG, GIF, files are allowed');
$("#mainphotoerror").css('display','block');
return false;
}
},
onComplete: function(file, response){ //alert(response);
if(response){
/*$(".main_image").html('');
$(".main_image").html(response);*/
$("#progressid").css("display","none");
$("#image"+<?php echo $mainimage->intphotoid; ?>).css('display','block');
$("#imagemainicon"+<?php echo $mainimage->intphotoid; ?>).css('display','block');
$("#mainimageicon").attr("src",response);
$("#mainimageicon").attr("width",55);
$("#mainimageicon").attr("height",55);
$("#mainimageicon1").attr("src",response);
}else{
alert("error");
}
}
});
});
<input type="button" id="browse" class="browse_media" value="Browse">
<div id="progressid" class="displayNone">
<img src="//s3.amazonaws.com/s3.racingjunk.com/102/images/procesing.gif" width="117" height="20" />
Uploading.....
</div>
當我點擊瀏覽按鈕時,我需要顯示進度條5分鐘。 5分鐘後,進度條會隱藏或不顯示。進度條隱藏後,圖像將顯示。
我該怎麼做?這可能嗎?
你問2個不同的東西 - >「在這裏,我想顯示進度條上傳後上傳時WOU LD不顯示」 ......然後‘我要上傳後顯示在5分鐘內酒吧將在’(拼寫糾正我的)....你到底做.... ???? – ManseUK
[Uploadify](http://www.uploadify.com/)可以AJAX上傳一個奇妙的溶液... – Lix