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

127
Visualizações
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 Respostas
Responde à pergunta

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 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