I'd advise driving through Yellowstone, also. Are you even planning to tour Yellowstone?
For staying in the Teton Nat'l Park you can try to get reservations (perhaps a cancellation) at Colter Bay RV in the Tetons. If not we stay in the dry campgrounds of either Gros Ventre - our favorite and closest to the town of Jackson, or Colter Bay campground right next to the above-mentioned RV park. Gros Ventre has a few electric sites that you might ask for. Both the dry campgrounds have 300 non-reservable sites and we've always gotten a site with our 40' motorhome.
Leave Cody early morning before the crowds hit the Yellowstone roads. You're also more likely to see animals in the morning.
Here's the official national park web site for the Tetons - lots of good information along with a map:
https://www.nps.gov/grte/index.htm