By playing some simple games like fetch with your dog, you can kill 2 birds with one stone. First is that the actual playing of the game will surely tire them out so much that they won’t have the energy to jump the fence. Second is that you are associating the fun of the game with the yard. If they have fond memories of the yard they will be less likely to try and get out.
You shouldn’t stop this type of jumping. You need to diagnose your dog's issue and remedy that. If your dog is just stressed being in a new situation, you should calmly get them off of you, offer them a treat to calm them down, and have them sit politely beside you until their stress level has subsided (or take them somewhere else so that they can calm down if it is taking a while for them to calm down.) But most of all, please do not just ignore this behavior change.
While the idea of "training" may seem daunting, it is simply teaching an animal what behavior works or doesn't work through resulting consequences — so whether you realize it or not, you are actually training your dog every moment of the day. Fortunately for you, preventing jumping is possible even without structured training. There are some simple solutions to this problem that require minimal effort and fit easily into your normal interactions with your dog.
An anxious or playful pup may leap high quickly and suddenly “poke” at your face with their nose. That can be triggered by leaning over the top of them especially when they’re in a high-arousal situation like a homecoming or around other dogs. It may be a way for stressed pups to relieve their anxiety, so be aware of situations that cause these behaviors. Dogs control each others' movement with their body language. Think how a Border Collie makes sheep move just by getting close. You can stop your pup’s jumps by stepping close to him just before he leaps. Cross your arms and step into the pup’s personal space before he crouches to leap.
Remember, Jumping up can be dangerous as well as annoying. Just as many owners are sued for their jumping dogs as their biting dogs. Young children and elderly people can easily be toppled over and seriously injured by exuberant, friendly dogs. Start now to teach your puppy not to jump up. Even little dogs can cause problems and injury to themselves and others when they jump up.
Understand the dog's behavior. In a dog's world, it is instinctual to greet another dog by coming nose-to-nose with them. This allows them to sniff each other's faces and become acquainted with the other dog's scent. Of course, your nose is a bit higher to reach so it is only natural that your dog will jump up to get closer to your face when greeting you. This can be quite annoying and unnecessary, but fortunately, the habit can be broken.
Many puppies don’t know their strength. When they jump up and you wave your arms and try to push them off, they may think it’s a game and grabs and bite harder. Tell them it hurts the same way another puppy would, with a YELP! Lay it on thick, overact and cry and sob like the pup has done major damage. Some tough dogs get the message using this. For the out-of-control grabby, ambush type of dog play, give him a taste of his own medicine and SCREAM (very loud but very short), and fall over “dead.” Don’t move and don’t say anything. Play dead for at least 15 to 20 seconds. The shock value may be enough to send a permanent message that such games stop all interaction, plus they hurt you—and playing dogs aren’t interested in hurting you and won’t want you to cry.
Start by teaching your puppy the word NO. Use that word only when she is doing something you do not like. You have to use the word NO in a loud, stern voice that is different from all other ways you communicate with her, so that she knows there is something wrong. You also have to catch her in the act that you don't like, so that it will associate the word NO with the action that she is doing. Be consistent, and follow your verbal command with a light smack or moving her to a time out spot.