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

287
Visualizações
How do I use drag events (dragover) in a #document embeded in an <object> tag?

An HTML file that I created is being displayed in an HTML object on the parent page. I am creating some drag events on my page and they work fine when calling my html file directly. But, when displayed inside an HTML <object> , the drag events (specifically trying dragover), do not fire, even though I see them listed in my event listeners. During my troubleshooting, I noticed this is not an issue when showing the page inside an <iframe>.

I don't have the option to me to use <iframe>, is there something I can do to allow the dragover event when displayed through the object tag?

<html>
  <head>

  </head>
  <body>
    <iframe frameborder="0" width="100%" height="100%" src="mytest.html"></iframe>
    <object width="100%" height="100%" data="mytest.html"></object>
  </body>
</html>
document.addEventListener("dragover", function(event) {
  event.preventDefault();
  dragovertest();
});

function dragovertest(){
  alert("popup");
}
about 4 years ago · Juan Pablo Isaza
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