Solve layout thrashing by caching a static value
Project
index.html

backing Plunker

index.html
Preview