When John Travolta sang “Greased Lightnin’,” in the hit 1978 film “Grease,” his libidinous command of the screen turned it into a leg-shakin’, hip-twitchin’, hair-gellin’ bundle of frenetic joy, an ode to awesome rides and heavy petting.

But the on-screen electricity belied the actor’s very real heartache. Diana Hyland, the love of Travolta’s life, died of cancer just before “Grease” went into production, and he was dealt a harsh reminder the morning that scene was filmed.

“People Magazine came out with a story about [Diana] that John didn’t like,” says Randal Kleiser, the film’s director. “He was distracted by it. It was hard for him to concentrate.”

So hard, in fact, that if you look closely you can see the results of Travolta’s sadness on screen.

“There’s a lyric where he sings, ‘heat lap trials,’ ” Kleiser says. “But on set, he kept lip-syncing ‘heap’ lap trials. I was beside the camera, yelling, ‘Heat! Heat!’ It didn’t work. If you look at the film, you can see his lips going ‘heap’ instead of ‘heat.’”

“Grease” will be re-released into theaters this Thursday in a special “sing-a-long” version, with the lyrics printed directly on the screen, and accompanying animations as hokey as the film itself.

In “Greased Lightnin’,” for example, when Travolta sings the words “p – – – y wagon,” they will be accompanied on screen by a picture of a cat and a wagon.

The film follows the love affairs and antics of a group of suspiciously old-looking 1950s high school students (Stockard Channing, who plays tough girl Rizzo, was 33 at the time). It’s basically a big ole’ bag of effervescent silliness, though a series of haunting coincidences cropped up during filming.

In the song “Look at Me, I’m Sandra Dee,” Channing swoons at a picture of Elvis Presley as she sings, “Elvis, Elvis, let me be, keep that pelvis far from me.”

Turned out that wasn’t to be a problem, as Presley had died earlier that day.

“It was very eerie,” says Kleiser, who got his start in movies as an extra on Presley’s films. “It was all over the news, so everyone knew. We did this number, and everybody kind of looked at each other like, ‘Yeah, this is creepy.’”

Sometimes, the creepiness came first.

“Beauty School Dropout,” Frankie Avalon’s light-hearted ode to Didi Conn’s Frenchie, came to life when the writers of “Grease” saw a news report about a teenage murderer who had dropped out of beauty school, and thought that “Beauty School Dropout” would make a good song title.

Whatever its warped inspiration, it’s something of a miracle that “Grease” came together as it did, since virtually none of the actors were the first choice for their roles.

Rizzo was initially offered to Lucie Arnaz, who passed because her mother, Lucille Ball, wouldn’t let her screen test. The virginal Sandy, played by Olivia Newton-John, was offered to “Partridge Family” star Susan Dey, who passed. Kleiser then considered Carrie Fisher, but when George Lucas showed him early footage of Fisher from the yet-to-be-released “Star Wars,” Kleiser couldn’t sense any musicality in her.

Newton-John was only offered the part after producer Allan Carr was charmed by her at a dinner party thrown by singer Helen Reddy, and told the film’s screenwriter that night to make Sandy Australian.

But the luckiest casting break came when Henry “Fonzie” Winkler turned down the role of Danny Zuko, clearing the way for Travolta. Kleiser had directed Travolta once before, in the 1976 made-for-TV movie “The Boy in the Plastic Bubble.” With the actor’s growing success on the hit sitcom “Welcome Back, Kotter,” certain things had changed by the time of “Grease.”

“He had more of an entourage than on ‘Bubble,’ ” says Kleiser. “And suddenly he had a good side and a bad side. On ‘Bubble’, it was, ‘Where do I stand?’ Now, he wanted to be shot from one side only.”

Travolta’s growing stardom led to some disagreements on the set. The song “Sandy” ends with a cartoon background shot of a hot dog diving into a bun.

Travolta had other ideas.

“He wanted a close-up [on him],” says Kleiser. “But that hot dog was fantastic. I didn’t want to shoot the close-up because I loved the hot dog. That was a battle, but I won.”

“Grease Sing-A-Long” opens Thursday at AMC Village, 66 Third Ave.