I have had the exact same trouble. As yours, it seems to come out of nowhere, last for anywhere between two days and a week, and then POOF. I'm okay again. I wish I had a more exact answer for you, but I really am not sure what causes it. For me personally, I believe that it is 50% stress induced... I think that when I'm stressed I'm more sensitive to things that normally wouldn't bother me. So, if I'm stressing, and I eat some leftovers... it could be disastrous. If I'm NOT stressing and I ate the same leftovers... I might have been fine? I dunno. I just wanted you to know that I know how you're feeling. It's so annoying to run to the bathroom and strain and strain - and for me - it's completely involuntary straining... I try to breathe and calm my body down - but it just won't listen. And all for what? Not even enough to make a tiny splash. I get really nasty chills, too, when this happens.
The best relief that I have found is this:
1. I make a fresh pot of chicken broth and eat only the broth and jello for a couple of days. (I just toss a whole chicken in a stockpot, and then when the meat is ready to fall off the bones, I take it out and just put back in the good tender pieces). Basically, I try to give my guts a rest. But, since that doesn't always stop the straining...
2. It sucks, but I get up several hours before I have to be anywhere, so that I can go through my whole routine before leaving the house. If I have to be at work at 8, I get up at 5, and wait for the stupidity to begin. I usually drink peppermint tea in the morning, as this not only "stimulates" my system, it also soothes it at the same time. In other words, you can poop what needs to be pooped, and move on with your day. After about 5 trips and/or 2 hous - I'm good to go.