optimize the performance by avoiding get clientHeight of a htmlElement every time