|Two newborns - Photo by theogeo|
It originates from medieval times in Britain. We are talking about the 5th - 15th century. Apparently if a pregnant women had pain in her abdomen it was thought that she had kittens inside her - she was possessed. The word "having" in the context of a pregnant woman means giving birth to. So having kittens meant giving birth to kittens. And if a woman was suffering emotional distress (e.g. panicky etc.) she might miscarry during pregnancy.
That, apparently, is the rather tortuous connection between "having kittens" and showing panic and hysteria.
Examples of use:
Women nattering over garden fence: "You know Ethel...She had kittens when she lost her Charlie....!"
"A burglar broke in to my house and I heard him and I was having kittens. "
"On November the fifth two rockets zoomed over my house and I was having kittens."
"I was having kittens all the way through the television program. I was scared he'd screw up..." (mother watching son on television competing in X Factor!).