Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

164
Vistas
Drag element to other page

Im trying to achieve behaviour where user could drag elements from a leaflet map to other page where there is another map.

To be able to drag out of the map and go hover over link in a navbar which after one second time redirects me to the other page, I did these steps:

1 - The whole page has onmousemove event listener (when dragging is active).

2 - When I want to start dragging some polygon from the map, I actually create a new element (looking similiar to the one in the map) with absolute position and the onmousemove listener is setting its position based on the cursors position.

3 - After hovering over the link and being redirected to the other page, after the reload, I reconstruct the "dragged" element and I re-add the onmousemove event listener (as in step 1). BUT because it should be drag n drop like experience, the user is still holding the left-mouse button down and the re-added onmousemove event listener starts doing its think only after user stop holding the left-mouse button down.

What I'd like to achieve is that the re-added onmouse event listens from the very beginning even if left-mouse button is down all the time during the page load. Or if there is other way how to go around this.

Thank you

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda