Stop transition if element is outside fo the DOM