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

110
Views
Cómo permitir que mi lienzo html pueda detectar automáticamente la pantalla del teléfono y restablecer su tamaño

Implementé un html de asignación en mi servicio k8s, pero cuando abrí esta página en mi teléfono, descubrí que aún conserva el tamaño de la computadora y no puede funcionar con fluidez. Quiero saber cómo solucionar este problema.

  • Solo implemento index.html en mi k8s. ¿Es ese el problema?

índice.html

 <body> <div class="container" style="display: flex;"> <h3>簽字</h3> <button onclick="reset()">清空</button> <button onclick="restore()">撤銷</button> <button onclick="upload()">上傳</button> <select class="selectColor" onchange="colorChange(event)"> <option value="black">黑色</option> <option value="red">紅色</option> <option value="blue">藍色</option> <option value="green">綠色</option> </select> </div> <div id='app'> <canvas id="canvas"></canvas> </div> </body> <script src="./plugin/canvas-sign.js"></script> <script> let cv = document.getElementById("canvas"); let rect = document.getElementById("app").getBoundingClientRect(); cv.width = rect.width; // console.log(app.getBoundingClientRect()); cv.height = rect.height; let canvas = new canvasSign(cv); let dataJson; canvas.on('drawend', (e) => { dataJson = canvas.toJson().dataJson; })

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

0

Puedes intentar tener tus estilos como dinámicos:

 let width=Dimensions.get('screen').width

o

 let width=Dimensions.get('window').width

lo mismo pasa con la altura

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!