Used adverbially in the famous pattern
前脚...
后脚... ('one moment X, the next Y') — describes two events happening in immediate succession, often with a sense of unfortunate timing or comic irony:
前脚出门后脚下雨 ('the moment you stepped out, it started raining').