Hi Allie,
I'm not a cat trainer, but I have had a cat like this (before I knew what to do, even with dogs) so I can visualize the problem.
One thing is to figure out her body language when you're petting her, what she does before the bite. Remember that the petting is mostly for your own entertainment, not for hers, and only pet her the minimum amount that would satisfy you, stopping when you see her start to get upset with it. Stiffening, rolling onto her back, etc. would be big signs, but look for smaller things, too.
For the leaping by, you can get in the habit, for a while, of bringing a treat and tossing it behind her (away from you) every time you pass by. This should develop a pattern of looking away as you pass by, and also some happiness if she's upset that you're passing by.
Or you might call her to you each time - to let her know the jig is up, that you know she's there, so the hunt is less fun.
You might also look at the space physically and see if you can add a barrier, so she can access it from the back, say, but not leap out the front. That may make it a not-so-favorite spot, but it's worth a try.