perf($animate): access DOM less in resolveElementClasses

Previously we were reading DOM attributes frequently, now we can do it just once.