티스토리 뷰
반응형
내 문제는 첫 번째 파일 형식으로 이미지를 업로드하고 두 번째 파일 형식으로 표시되는 동일한 이미지보다 미리 볼 때입니다. 첫 번째 이미지가 첫 번째 파일 형식으로 표시되고 두 번째 이미지가 두 번째 파일 형식으로 표시되어야합니다.
function workimage_preview(input) {
if (input.files && input.files[0]) {
var $input = $(input);
var reader = new FileReader();
reader.onload = function(e) {
$input.closest('.insert-img').find('.show-uploaded-img').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
$(".work_pic").change(function() {
workimage_preview(this);
});
<div class="insert-img d-table">
<img src="https://www.eastmanhandtools.com/new/upload/final_pro/big_img/placeholder-image.png" alt="user-img" class="show-uploaded-img">
<div class="d-table-cell">
<input type="file" class="work_pic" name="work_pic[]">
<label for="work_pic" class="text-underline">Upload</label>
</div>
</div>
<div class="insert-img d-table">
<img src="https://www.eastmanhandtools.com/new/upload/final_pro/big_img/placeholder-image.png" alt="user-img" class="show-uploaded-img">
<div class="d-table-cell">
<input type="file" class="work_pic" name="work_pic[]">
<label for="work_pic" class="text-underline">Upload</label>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
반응형
'프로그래밍' 카테고리의 다른 글
커널모드 동기화 기법 - 스핀 락 (0) | 2020.03.02 |
---|---|
뷰 모델이 올바르게 바인딩되지 않습니다 C # (0) | 2020.03.02 |
C# BeginRead (0) | 2020.03.02 |
VUEX, $ store.state가 null 일 때 수행 할 작업 (0) | 2020.03.02 |
Windows 필터링 플랫폼 트래픽 검사 샘플 (0) | 2020.03.02 |
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- SWiFT
- 투자
- Windows
- 생각
- golang
- ios
- 부동산
- 유튜브
- 예제
- 스핀락
- JSX
- 파이썬
- Backend
- 커널드라이버
- Frontend
- Python
- CSS
- 트렌드
- go
- Spring
- Java
- Linux
- 주식
- ChatGPT
- HTML
- JavaScript
- WinAPI
- react
- frida
- reactjs
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
글 보관함