I've had a syncope like that before when I was younger.
I had the flu at the time, and one morning I immediately got out of bed and went to the bathroom. On the way back to my room, I started to feel dizzy and noticed my eyesight fading. First it seemed to go black and white, then to tunnel-vision, as if I could only see what was directly in front of me. My hearing faded as well - I was on the verge of collapsing (unbeknownst to me) and I could hear my family shouting out as if I was listening to them through a poor AM radio signal and speaker. My father grabbed me before I collapsed and hit my head on the corner of a desk.
After going to the doctor, we determined the causes:
* Standing up too quickly (jumping straight out of bed)
* Low blood pressure
* Possible dehydration
* Going to the bathroom
The trick to prevent passing out when you start feeling dizzy is to get blood flowing back into your head. The easiest way to do that is lie on your back and lift your feet high in the air. And of course, keep hydrated and avoid standing too quickly.
From your mention of the bathroom floor, I can only assume you were urinating while standing, which is a very common trigger for http://en.wikipedia.org/wiki/Vasovagal_response. For more specific definition see: http://en.wikipedia.org/wiki/Micturition_syncope
Not a big deal really, but as always might want to get it checked out to rule out more serious conditions.