上傳圖片時button按鈕隱藏,用做好的樣式

jsp: <div class="input-box">
<span>主題首頁</span>
<div class="img-box">
<img class="img-icon" src="${ctx}/${subject.picUrl}" id="imgs"
alt="" style="width: 100%; height: 100%; top: 0;" /> <input
name="filepathsave" id="filepathsave" type="hidden"
value="${subject.picUrl}" />
</div>
<p class="check-img">
<input type="file" id="files" οnchange="onChangeUploadImage(this)" 
multiple="multiple" style="opacity: 1" type="hidden">
<button οnclick="clickFileInput()">選擇圖片</button>
(本格式支持jpg、png等格式)
</p>

</div>

js: $('#files').hide();//讓按鈕隱藏

function clickFileInput(){
$("#files").click();
}

//點擊按鈕時觸發選擇圖片事件

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章