I'm doing some testing with jquery
, and I came up with the following question:
Is it possible to manipulate pseudoelements of css
classes with jquery
?
$('#login_1').click(function(event){
event.preventDefault();
if($('#principal-modais').css('display') == 'none') {
$('#principal-modais').css({'display':'inline-block'});
$('html').addClass('modais-ativos');
setTimeout(function(){
$('.modais-ativos:after').css({'background-color':'rgba(0,0,0,.7)'});
$('#principal-modais').css({'opacity':1});
},100);
}
});
$('#fecha-modais').click(function(event){
event.preventDefault();
if($('#principal-modais').css('display') != 'none') {
$('#principal-modais').css({'opacity':0});
$('.modais-ativos:after').css({'background-color':'rgba(0,0,0,0)!important'});
setTimeout(function(){
$('#principal-modais').css({'display':'none'});
$('html').removeClass('modais-ativos');
},1000);
}
});
Then I performed the above code as a test, but without success, if it is possible to access the element / class selectors, how could it be done?