CSS or Jquery - How to leave an entire page with Pointer-Events: None; less such element

Asked

Viewed 81 times

0

I want to leave everything inside the div .divGeral with pointer-events: none; minus the class .divnaomodificavel

This is my code, below...

HTML:

<div class="divGeral">
        <div class="msgdeerro">Nome de Usúario ou Senha Incorretos!</div>
        <a class="link" href="linkGeral.php"><span class="esqueciSenha">Link Geral</span></a>
        <div class="divsegura">Selecione aqui seu texto: <div class="divnaomodificavel">Texto para copiar!</div></div>
</div>

CSS:

.divGeral {
    pointer-events: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

I’m waiting for help... It can be in jquery or css but I prefer css...vlw!

  • the reason to withdraw all the pointer-events? This seems to me to be a very "Hacky" solution. if you add your goal we can guide you to a better and more reliable solution.

1 answer

1

I think the best way would be to give a class to the element that you would like to keep the Pointer Vents and set so that everything within the div would keep except that. Example assuming you could put the class pointer on your link:

.divGeral > *:not(.pointer) {
    pointer-events: none;
}

Class pointer on your link:

<a class="link pointer" href="linkGeral.php"><span class="esqueciSenha">Link Geral</span></a>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.