Bearing in mind that JavaScript is no longer formally supported, I should note that top-down mode is no longer set by users, but by developers. In effect this means that there is a policy flag that you need to set in order to activate top-down tracking. This basically tells the Leap Motion Controller to assume that it's looking at your hands from a top-down perspective.
Importantly, you will still need to move the virtual controller within the virtual scene for the hands to appear in the correct position with relation to the camera. (Or, alternatively, you can always just move the camera.)