cache `element.getOffsetParent()` to optimize

cache `element.getOffsetParent()` to optimize code after nice suggestion
from @anutron