Seeking a way to create a dimmed-background effect by adjusting the opacity of all elements on the page except for one specific element. I've experimented with using the :not()
selector as well as jQuery selectors to exclude certain elements, but have not been successful. Does anyone have suggestions on how to achieve this using SASS/Compass or potentially with jQuery?
Some of the approaches I've tried include:
.opacityFade:not(.classToExclude) {
STYLES HERE
}
or
$('controlElement').click(function(){
$(body).not('desiredTargetToExclude').toggleClass('classThatFadesStuffOut');
});
Ideally, I would prefer to avoid writing additional JavaScript and instead keep responsibilities separated. However, I'm relatively new to Front-End development and unsure of the best approach. Any advice is appreciated! Thanks!!