support for reverse transition

Funny thing: when I wanted to test the functionality there seems to be a z-index error... however this is also the case with the unmodified version.