3 ms·
Toggling visibility (and other stuff) is best done by changing classes on the element.
by rimantas 10y ago
Toggling visibility (and other stuff) is best done by changing classes on the element.
- hmottestad 10y agoI think you should consider the trade-off. If you toggle visibility with CSS, you still have to put everything in the DOM. Sometimes, putting things in DOM can be very expensive. Consider a date picker, a fairly complicated thing with many sub-elements. If you have to put thousands of date pickers in the dom, that's going to take a lot of time. Especially if the user only sees one if they click on an event to edit it.
- flukus 10y agoWhy not create one and move it around as necessary? I'm pretty sure that's what most date picker libraries do. Although you'd probably be moving it's location with js.