lundi 29 juin 2015

What's faster, to hide/show an HTML element, or to delete/insert it?


I am developing a navbar where the selected button is marked by a triangle. Do I put a triangle in every button of my navbar and keep all but one triangle invisible (or visible but same background as the button)? Or do I delete the triangle and reinsert it in the new button?

I understand the performance impact would probably be negligible, but I am learning my ropes, so mostly asking out of curiosity (and wanting to learn the best practices)


Aucun commentaire:

Enregistrer un commentaire