i'm working on a fullscreen clickable slideshow with overlaying. While the starting color of this menu is white, i'm wondering if it is possible to maximize legibility by switching to black on lighter images. The order of the slideshow is permanent, so there is nu guesswork involved with which image should show a white or black version. Is there a simple solution for this problem?
I'm aware that there are countless questions around this topic, but it seems that in all these cases text is nested in. Or the suggested .js scripts are way to elaborate for (what seems) such a simple problem.
Thanks in advance.
HTML
<div class="fullscreenslideshow">
<div style="background-image:url(image1)" class="dark"></div>
<div style="background-image:url(image2)" class="light"></div>
<div style="background-image:url(image3)" class="light"></div>
<div style="background-image:url(image4)" class"dark"></div>
</div>
JS
$('.dark').click(function(){
jQuery('h2').toggleClass('textlight');
});
$('.light').click(function(){
jQuery('h2').toggleClass('textdark');
});
CSS
.textlight {
color:#FFF;
}
.textdark {
color:#000;
}