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. Maybe I find some time to look into it some other time..