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

138
Views
Bola de visualización de Javascript con número cuando se hace clic

El siguiente código muestra que hago clic 4 veces, la salida es como pic1

 let sep = s.messages[s.player_at_the_table] == "" ? "" : "・"; s.messages[s.player_at_the_table] += sep + "1"; s.messages[s.player_at_the_table ^ 1] = "";

pic1 - salida actual

Me gustaría hacerlo como pic2, la suma de la salida con fondo de bola roja.

pic2 - mi salida esperada

Este enlace es mi enlace web JS: https://score-uat.hk147.com/matches/score/G2fyH2CCgsuX3kLXX

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

0

En realidad, no estás dando muchos detalles sobre la pregunta, ¡pero déjame intentarlo!

 document.querySelector(".counter").addEventListener("click", function () { this.textContent = parseInt(this.textContent.trim()) + 1; });
 .counter{ font-size: 30px; --size: 2em; width: var(--size); height: var(--size); border-radius: 50%; background-color: #ff0000; color: #ffffff; box-shadow: 0px 0px 0.25rem 0px hsla(0, 0%, 50%, 0.5); display: flex; align-items: center; justify-content: center; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(1); font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; transition: transform 100ms ease; cursor: pointer; user-select: none; } .counter:active{ transform: translate(-50%, -50%) scale(0.9); }
 <div class="counter">0</div>

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!