Reputation: 33
how can i assign the "navMenu__logo .transparent" to toggleClass? It will work with the .transparent class if i comment it out.
$(document).ready(function(){
$( ".navMenu__logo" ).click(function() {
$( this ).toggleClass( "transparent" );
});
});
.navMenu__logo .transparent {
opacity: 0.1;
}
/*
.transparent {
opacity: 0.1;
}
*/
Upvotes: 1
Views: 47
Reputation: 85545
It should have no space between:
// -----------v
.navMenu__logo.transparent {
opacity: 0.1;
}
Giving a space, you're telling the .transparent
element is inside .navMenu__logo
which isn't the case.
Upvotes: 4