Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

249
Visualizações
How to know if the user is dropping the file on the defined location?

On this application, the user can drag and drop a file on the specified location. Let say here:

<div id="dropZone" style="width: 200px; height: 100px;"></div>

However, we noticed that no matter where the file is drop, the webpage will process it. Here is an example taken online https://jsfiddle.net/oL2akhtz/. There is a place to drop the file, but no matter where you leave it, it will stay. How to know if the user is droping the file in the right place? Or how do you disable the cursor if the user is not droping the file where it should be?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

it actually only works on the dropzone because it has full width and height. and the drag is set to window, when a user drags over the window, the div will be visible but will not receive any files

to fix it

  1. Optimize the height and width:
div#dropZone {
  background: gray;
  position: fixed;
  top: 0;
  left: 0;
  width: 30%;
  height: 30%;
  z-index: 999;
  opacity: 0.6;
  visibility: hidden;
}
  1. I'm not sure, but if you tried to fix it by allowing and denying the user from dropping it outside the drag area, delete the functionality because it's useless.
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda