Re:Show HN: hint.css – a tooltip library in CSS
by ryankshaw on Monday February 04, 2013 @11:04AM
(#5164780)
one caveat, any approach like this (one that just uses css) will hide the tooltip if the thing it is tipping (or one of it's parents) is clipped by overflow:auto/scroll/hidden. the only way to get around that is using javascript (the tooltip needs to be inserted into the dom outside of the element with constrained overflow, eg: as a child of body). I've found that in any decent size project I've done, eventually I run into that scenario, so I usually just start with a JS based approach from the beginning (bootstrap, jqueryUI, etc)
[ Parent
| on HN ]
Re:Show HN: hint.css – a tooltip library in CSS
by dhaffner on Monday February 04, 2013 @12:23PM
(#5165481)
Just thinking aloud here. Could that problem be avoided by putting the tooltip element outside of the thing it is tipping, and then using a CSS selector like ".tipped-element:hover + .tooltip-element"?
I'm sure there are some other caveats that would reveal themselves later even if this one is avoidable...
Re:Show HN: hint.css – a tooltip library in CSS
by philipwalton on Monday February 04, 2013 @11:29AM
(#5164963)
I was going to say the exact same thing, but you beat me too it!
I started with this approach when I built our tooltip library for my company, but eventually there were just too many gotchas. We switched to using JavaScript and inserting the generated element as a child of `body`.