I have the same issue with a JavaScript dropdown menu and I have seen (can not remember the location of the sites unfortunately) dropdowns that appear change direction when they hit the edge of a specified container div. Is there a such thing as edge detection or hit tests in jQuery or javascript or do people just make new classes with float:right for the menus that are in danger of going off screen