1590s "to fillip, to toss with the thumb," imitative, or perhaps a thinned form of flap, or else a contraction of fillip (q.v.), which also is held to be imitative. Meaning "toss as though with the thumb" is from 1610s. Meaning "to flip a coin" (to decide something) is by 1879. Sense of "get excited" is first recorded 1950; flip (one's) lid "lose one's head, go wild" is from 1949, American English; variant flip (one's) wig attested by 1952, but the image turns up earlier in popular record reviews ["Talking Boogie. Not quite as wig-flipping as reverse side--but a wig-flipper" Billboard, Sept. 17, 1949]. Related: Flipped. Flipping (adj.) as euphemism for fucking is British slang first recorded 1911 in D.H. Lawrence. Flip side (of a gramophone record) is by 1949.
also flip flop, "plastic thong beach sandal," by 1970, imitative of the sound of walking in them. Flip-flap had been used in various senses, mostly echoic or imitative of a kind of loose flapping movement, since 1520s:
Flip-flaps, a peculiar rollicking dance indulged in by costermongers, better described as the double shuffle; originally a kind of somersault. [Hotten's Slang Dictionary, 1864]
Flip-flop in the general sense of "complete reversal of direction" dates from 1900; it began to be used in electronics in the 1930s in reference to switching circuits that alternate between two states. As a verb by 1897. Flop (n.) in the sense "a turn-round, especially in politics" is from 1880.
The main modern verbal sense of "play at courtship" (1777) probably developed from the noun (see flirt (n.)) but also could have grown naturally from the 16c. meaning "to flit inconstantly from object to object." To flirt a fan (1660s) was to snap it open or closed with a brisk jerk and was long considered part of the coquette's arsenal, which might have contributed to the sense shift. Or the word could have been influenced from French, where Old French fleureter meant "talk sweet nonsense," also "to touch a thing in passing," diminutive of fleur "flower" (n.) and metaphoric of bees skimming from flower to flower. French flirter "to flirt" is a 19c. borrowing from English.