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

169
Views
cómo evitar eventos de puntero: ninguno afecta un botón dentro del elemento con este estilo

Quiero que se pueda hacer clic en el botón dentro del .container , aunque tenga la propiedad pointer-events:none .

El contexto es este: en mi código real, debo evitar que un div principal (algo del estilo del div que tiene la clase .container ) no se pueda arrastrar, o hacer clic y arrastrar a algún lugar.

Creo que si hay una manera de resolver esto, mi problema está resuelto. este es mi código:

 function myFunction(){ alert("click") }
 .container{ width:30vh; height:30vw; background:red; display:flex; justify-content:center; align-items:center; pointer-events:none; }
 <div class="container"> <button onclick="myFunction()">click</button> </div>

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

0

Agregue pointer-events: all o pointer-events: auto al estilo de su botón.

 function myFunction(){ alert("click") }
 .container{ width:30vh; height:30vw; background:red; display:flex; justify-content:center; align-items:center; pointer-events:none; } .container button{ pointer-events: all; }
 <div class="container"> <button onclick="myFunction()">click</button> </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!