Start by finding an example of what exactly you are looking for. Then see how they did it and you may be able to use the same plugin or technique. Since it will be javascript based, you should be able to investigate it by viewing the source code of a page doing something similar to what you want.