I get those jittery but painless muscle quivers too, thighs and calves. I also get painful cramps, usually right after a hard workout ride and while I'm sitting or sleeping.
Magnesium lactate seems to work better for me than the more common magnesium oxide. It's also in Sportlegs supplement but kinda pricey. I buy it in capsule form, open the gel cap and pour it into an energy drink of my own concoction, which I drink before and after rides. Magnesium lactate can make some folks gassy so watch out the first time you try it, especially if you're lactose intolerant. I take it with digestive enzymes so there's no problem.