2013-03-07 2 views
0

버튼과 드래그 드롭 영역이 있습니다. 이 버튼에 valums 파일 업 로더를 적용하고 싶습니다. 하지만 드래그 드롭 영역을 다른 상자로 유지하고 싶습니다. 그것을 어떻게 성취합니까? 다음과 같이 내 현재의 구현은 다음과 같습니다Valums 파일 업 로더 드래그 드롭 영역 변경

  that.imageUploader = new qq.FileUploaderBasic({ 
       button: $('#sprPictureUpload')[0], 
       action: '/ui/rest/utils/upload/image/file', 
       allowedExtensions:SUPPORTED_IMAGE_TYPES, 
       forceMultipart: true, 
       multiple: config.multiple, 
       inputName: 'photoFile', 
       onSubmit: function(id, fileName) { 
        renderImagePlaceHolders.call(that, id, fileName); 
       }, 

      }); 

을 그리고 HTML은 다음과 같습니다

<section class="upload-section" data-section="upload"> 
    <div class="upload-area"> 
     <div style=""> 
      <h3 style="color:#aaa"> 
       Drag images here 
      </h3> 
      <h5 style="color:#aaa"> or if you prefer ...</h5> 
      <a id="sprGenericPictureUpload" class="btn btn-primary"> 
       <i class="icon-upload icon-white"></i> Choose image to Upload 
      </a> 
     </div> 
    </div> 
</section> 

그래서 내가하고 싶은 것은 #sprPictureUpload 클릭하고 사진 업로드를 시작해야 .upload-area 섹션에서 아무 곳이나 드래그합니다. 동일한 구성으로 두 개의 다른 요소에 업 로더를 적용하는 방법이 있습니까?

+0

뿐만 아니라 당신의 HTML을 제시해주십시오. –

+0

html로 질문을 업데이트했습니다. –

+0

FineUploaderBasic을 사용하지 않으면 훨씬 쉬울 것입니다. 왜 모든 DnD 코드를 제공하는 FineUploader 모드를 사용하지 않습니까? 추가 드롭 존을 추가하거나 기본 드롭 다운을 비활성화 할 수도 있습니다. –

답변