hovercard.js is a lightweight widget for displaying content on hover that knows about collision detection. given a container, defined by providing an ID selector on init(), the displayed hovercard can flip horizontally so that it doesn't display outside of the container element.
NOTE: This script has no dependancies (does not require a framework like jQuery) and supports the latest chrome, firefox and ie 10+ on windows as well as safari, firefox and chrome on osx.