Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

123
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!