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

107
Views
scrollLeft se desplaza a un valor de px no redondo

uso scrollLeft para desplazarme a la derecha 50px

pero luego registro el valor de scrollLeft, es 49.599998474121094px no 50px

cómo hacer que se desplace 50px

esto es lo que muestra

gracias por su apoyo

 function myFunction() { var elmnt = document.getElementById("myDIV"); elmnt.scrollLeft += 50; elmnt.scrollTop += 10; document.getElementById ("demo").innerHTML = "Horizontally: " + elmnt.scrollLeft + "px<br>Vertically: " + elmnt.scrollTop + "px"; }
 #myDIV { height: 250px; width: 250px; overflow: auto; } #content { height: 800px; width: 2000px; background-color: coral; }
 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <p>Click the button to scroll the contents of div by 50px horizontally and 10px vertically.</p> <p><strong>Tip:</strong> Click the button many times to scroll the same amount each time.</p> <button onclick="myFunction()">Scroll contents of div</button><br><br> <div id="myDIV"> <div id="content"> Some text inside a div element.<br><br> Some text inside a div element. </div> </div> <p id="demo"></p> </body> </html>

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

0

Lo más probable es que la ventana de su navegador Chrome esté configurada con un zoom del 125% , lo que lleva a este resultado incómodo:

49.599998474121094px

Establezca el Zoom al 100% y ahí está:

50px

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!