CSS or JQuery - How to leave an entire page with pointer-events: none; minus such element

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 looking for help ... Can be in jquery or css but I prefer css ... vlw!

    
asked by anonymous 23.02.2017 / 03:16

1 answer

1

I think the best way would be to give a class to the element you'd like to keep the pointer events and set it to keep everything inside the div except that. Example assuming you could put the pointer class on your link:

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

Put the pointer class in your link:

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