Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

696
Views
Cómo poner una imagen en un área de arrastrar y soltar (dropify) a través de jquery- Dropify dinámico

Tengo un área de dropify (arrastrar y soltar) en mi sitio web. Necesito llenar el área de arrastrar y soltar con la imagen existente para que los usuarios puedan ver la imagen anterior y puedan cambiarla si lo desean. Posibilidades 1. ¿Hay alguna forma de generar un disparador con un nombre de archivo antiguo? para que Dropify JavaScript pueda detectar el evento y pueda manejar el resto 2. ¿Hay alguna forma de establecer explícitamente la imagen en el área de Dropify desde otro archivo JavaScript?

código:

 <pre> <div class="form-group" id="id_photo_group"> <label >Photo*</label> <input type="file" class="dropify" data-height="300" id="id_member_photo" name="n_member_photo"/> </div> </pre>
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Agregar campo de entrada como de costumbre

archivo html

 <input type="file" name="n_service_img" id="id_service_image" />

Desde el archivo jquery, agregue la clase "dropify" y configure sus atributos y llame a la función dropify

archivo jquery

 $("#id_service_image").addClass('dropify'); $("#id_service_image").attr("data-height", 300); $("#id_service_image").attr("data-default-file", "../img/ourservices/MEDICAL-SERVICES.jpg"); $('.dropify').dropify();
over 4 years ago · Santiago Trujillo Report

0

Ahora puede poner la imagen predeterminada usando la variable data-default-file

 <input type="file" class="dropify" data-default-file="url_of_your_file" />

defaultFile : si hay un archivo predeterminado en la entrada. Puede usar opciones cuando usa el complemento o directamente data-default-file="url_of_your_file" en su elemento DOM (se recomienda).

Fuente

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!