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

192
Views
Problema con getBoundingClientRect()

tengo problemas con un control deslizante en codepen. Lo implementé en mi sitio web y me di cuenta de que el resaltador blanco del contenido se mueve si me desplazo por el sitio web. El resaltador blanco se mueve hacia arriba y hacia abajo. Realmente no sé cómo arreglar eso. El código original también tiene el mismo problema. Tal vez alguien tiene una idea? El Código está en codepen.io/JavaScriptJunkie/pen/ZMMRRQ

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

getBoundingClientRect() proporciona las coordenadas para el rectángulo que se ve actualmente en la pantalla. Simplemente agregando window.pageYOffset (es la altura sobre la ventana gráfica hasta la parte superior de la página) a la nueva coordenada Y, puede compensar esta posición Y cambiante.

Ver 16 en esta bifurcación de tu Codepen: https://codepen.io/yoat/pen/XWzqRKJ

 var x = this.getBoundingClientRect().left; // only the y position changes, not the X or the height! var y = this.getBoundingClientRect().top + window.pageYOffset; var width = this.getBoundingClientRect().width; var height = this.getBoundingClientRect().height;
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!