Fixed false distance reading

Also added linear easing as fallback when easing pattern not recognized
to prevent script from failing.
Merge branch 'fix-offsetTop'