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

124
Vistas
moving elements in and out of screen on 360 degree div

I am trying to workout how to move elements off the screen or return back to screen. I have 360 degree equirectangular image. And putting elements on that image's certain points. So when image's view degree changes, trying to move those elements on it too. For example.

const mouseDownHandler = (e: MouseEvent): void => {
  clicked= true
}

const mouseUpHandler = (e: MouseEvent): void => {
  clicked= false
}


const mouseMoveHandler = (e: MouseEvent) => {
  if (clicked) {
    elements.forEach(item => {
      item.style.left = (item.computedStyleMap().get('left').value + e.clientX /  window.innerWidth * 100) + "%";
    })
  }
}

with the code above, elements are moving but ofcourse on every click and move elements popping up where mouse clicked and follows it while moving. I understand the problem. e.clientX / window.innerWidth * 100) is always points the cursor. So how can I solve the issue here?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It's quite hard to understand what you want to achieve, a codepen would really help if you have one

about 4 years ago · Juan Pablo Isaza Denunciar
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