From its ridiculously catchy opening number, through its funny but wholesome satire of early-’60s innocence, to its deliriously happy finale, “Hairspray” is as delightful and entertaining a musical as Hollywood has produced in years. It doesn’t just entertain you; it makes you happy.

Based on the 2002 Broadway musical (which itself was based on the 1988 non-musical John Waters film), “Hairspray” is set in the colorful, not-quite-slummy Baltimore of 1962, where a chubby but happy teenager named Tracy Turnblad (Nikki Blonsky) and her best friend Penny (Amanda Bynes) rush home after school each day to watch “The Corny Collins Show,” a teen dance program similar to “American Bandstand.”

Tracy’s greatest wish is to be a dancer on the show, and to get the attention of lead hoofer Link Larkin (Zac Efron), who goes to her school but never pays attention to her. But Tracy’s mother, the housebound and self-conscious Edna (John Travolta, in a dress and a fat suit), discourages her from auditioning. They don’t choose girls like us, she tells her, “us” being girls who aren’t rail-thin.

Tracy winds up on the show anyway, though, and Link is smitten with her — much to the dismay of his ambitious blond girlfriend and fellow dancer Amber Von Tussle (Brittany Snow), whose former-beauty-queen mother Velma (Michelle Pfeiffer) is the TV station’s manager. Further aggravating the situation: Tracy thinks that instead of having each Tuesday set aside as “Negro Day,” where black teens appear on the show, they should just integrate and let teens of all races dance together every day.

It’s that kind of forward-thinking that causes revolutions, you know, and soon Baltimore is embroiled in the sunniest, toe-tappingest civil rights movement you ever did see. At the center is Tracy and Penny’s new black friend Seaweed (Elijah Kelley) and his mother, Motormouth Maybelle (Queen Latifah), a record-store owner whose business is often the site of ad-hoc dance parties for local black teens.

The issues at play sound serious, but believe me when I tell you the film is not preachy or strident. Its social satire is generally subtle and understated; most of all, the movie’s just FUN. Good heavens, is it ever fun. I marvel at how well the songs, written by Marc Shaiman (“South Park: Bigger, Longer & Uncut”) and Scott Wittman, hit their targets. Each one is optimistic and up-tempo, usually involving a key change that makes an already-invigorating tune soar even higher. The themes are inspiring, too: “Welcome to the ’60s” has Edna Turnblad coming out of her shell, “Run and Tell That” is an infectious “black and proud” number, “Big, Blonde and Beautiful” celebrates being comfortable in your own skin even if you’re overweight. Even the opening number, “Good Morning Baltimore,” which isn’t really about anything other than general teenage cheerfulness, feels like an anthem of positive thinking and goodwill.

The film was directed and choreographed by Adam Shankman. This is Shankman’s sixth film; it is the first one not to be utterly wretched. (Some of his prior offenses: “The Pacifier,” “Cheaper by the Dozen 2.”) I think here he has found his calling. Where so many modern musical films employ fast editing and screwy camera angles, Shankman — justifiably proud of his choreography — lets the camera linger long enough for us to actually see what the dancers are doing. Yet there is enough camera movement and film editing to match the pace and energy of the scenes, too.

Granted, he had excellent source material to work with, but that’s not a guarantee of success. Plenty of shows that worked on the Broadway stage have failed when they were converted to the silver screen. Whether “Hairspray” was closer to Shankman’s heart than his previous projects, or whether he had more help on this one, or whether this is just a fluke, I don’t know. The point is, he guides “Hairspray” as if he were actually a good director. He never has been before, but maybe that’s all in the past now.

The film’s one weakness is that there are obviously some scenes missing — “obviously” not because I remember them from the stage version, but because just watching the movie, you can tell that certain elements are incomplete. Much is made of a local clothier’s desire to make Tracy his spokesmodel, and then we never see him again. There’s a curious scene where Velma Von Tussle tries to seduce Edna’s husband, joke-shop-owner Wilbur (Christopher Walken), and not only is it ineffective, but it’s not even clear why she’s doing it. (She wants Tracy off the show, so she seduces Tracy’s dad? What? Surely there are more direct ways to get rid of Tracy.) I get the feeling there may be scenes on the DVD that bring a little more sense to all this.

So far I’ve made scant mention of John Travolta. This man, like Shankman, has been responsible for a lot of bad movies in recent years. Yet also like Shankman, “Hairspray” is his redemption. His bizarre Baltimore (“Bawmur”) accent, his giant meaty face made even gianter and meatier by prosthetics, his eyes still way too close together — that’s all surface stuff that makes him a curiosity more than a character. But then, son of a gun, Travolta totally nails the performance. He makes Edna sympathetic and likable and strangely real. He makes us cheer when she starts to gain confidence through her daughter’s actions. He doesn’t overplay the part, which is often the temptation when playing a larger-than-life character (especially one of the opposite sex), but he is fully committed to Edna’s quirks and foibles, and to the film’s sunny-side-up ethos.

Edna and Wilbur have a number where they tell each other that their love will remain strong despite their advancing ages, receding hairlines, and growing waistlines. It is indeed a surreal pleasure to see Christopher Walken and John Travolta work together in a charming, old-fashioned song-and-dance number. The two characters are so sweet and sincere that the fact that one of them is being played by a man in drag becomes irrelevant.

All of the supporting cast is fantastic, too, though Zac Efron (cast because of his “High School Musical” fame) could use a little more experience, and Amanda Bynes doesn’t get to do much. There’s still Allison Janney as Penny’s prudish mother, James Marsden’s surprisingly charismatic turn (and what a voice!) as Corny Collins, Elijah Kelley executing some stunning moves as Seaweed, and Michelle Pfeiffer vamping it up deliciously as the villainous Velma Von Tussle.

The film’s philosophy is that you should be yourself and be happy regardless of your race or body type. Old, young, fat, thin, black, white, so what? Let’s all just sing and dance together. You’ll come out of the movie happier than you went in, and humming a few peppy new tunes to boot.

A- (1 hr., 57 min.; PG, some mild innuendo and double-entendre; a little very mild profanity.)