this post was submitted on 21 Jan 2026
379 points (99.2% liked)

Programmer Humor

28764 readers
1806 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] mikazuki@lemmy.world 10 points 4 days ago (1 children)

Don’t just override opacity with null , it will override whatever the original style was. Before setting to 30% you need to store the original value and restore that in the timeout.

[–] bestelbus22@lemmy.world 14 points 4 days ago (1 children)

null will actually default back to the rules coming from CSS, I use this all over the place as a pattern

[–] victorz@lemmy.world 2 points 4 days ago (1 children)

But if the element itself already had an inline opacity value, that would be lost. 🙂

[–] bestelbus22@lemmy.world 2 points 3 days ago (1 children)

Yes very true, and also not likely at all ;)

[–] victorz@lemmy.world 2 points 3 days ago

Not in your code perhaps, which is a good thing 👍