Study the source code of this demo, or read about this cute little plugin on its pink and blue presentation page