3 ms·
The application is when you need something to be positioned next to something else as an overlay. Like a dropdown, details on hover, etc. Like the dropdown he
by elmin 13y ago
The application is when you need something to be positioned next to something else as an overlay. Like a dropdown, details on hover, etc.
Like the dropdown here: http://github.hubspot.com/select/docs/welcome/ http://github.hubspot.com/select/docs/welcome/
Or the overlays here: http://github.hubspot.com/shepherd/docs/welcome/ http://github.hubspot.com/shepherd/docs/welcome/
You could write the positioning javascript yourself, but the element's won't be smart enough to reposition themselves when they hit the edge of the screen. They also won't be smart enough to pick the appropriate positioning method (absolute, fixed, or absolute within the scroll parent) which will result in the fewest repaints. You probably also don't use CSS transforms much, so you won't add that optimization. Also, you won't be able to optimize multiple overlays existing on the page at once into a single repaint.
Also, you'll have to write all that js yourself, this is a library, ready and waiting at your convenience.