I have a script that adds a class "notransition" to the body on the page load (it removes it after set time). I want to remove background-color and color transition from every element, but it doesn’t seem to work.
$(window).on("load", function(){
$("body").addClass("notransition");
setTimeout(function(){
$("body").removeClass("notransition");
}, 1000);
});
.notransition *{
transition-property: background-color, color !important;
transition-duration: 0s !important;
}
However, I can remove every transition with code like this:
.notransition *{
transition: none !important;
}
Is it possible to apply it only to color and background-color properties?
2
Answers
Try this code which may help you to fix your problem:
If I understand your quest properly it should be reverse, e.g.
setTransition
instead ofnotransition
if you want to flash text on page load: