JSFiddle - React, Tailwind, and code Playground
by Per Ă…strand
HTML
<div class="informations">
When this is shown, other elements get white color.
</div>
<div id="logo">
Logo
</div>
<div id="totale">
Totale
</div>
<div class="submenu">
Submenu
</div>
<div id="fp-nav">
Fp-nav
</div>
CSS
.white-text {
color: #fff;
background-color: #000;
}
.informations {
display: none;
}
JavaScript
(function($) {
$.each(['show','hide'], function(i, val) {
var _org = $.fn[val];
$.fn[val] = function() {
this.trigger(val);
_org.apply(this, arguments);
};
});
})(jQuery);
$(".informations").on("show", function() {
$("#logo, #totale, .submenu, #fp-nav").addClass("white-text");
});
setTimeout(function() {
$(".informations").show();
}, 2000);