I had a problem similar to that with a Logitech optical mouse and fixed it by taking a Qtip with a little alcohol and cleaning out the sensors.
That happened twice on that mouse so I picked up a Microsoft Laser mouse and have not had any problems since.