Updated 'getOffset' function as it was giving incorrect offset of the element when mobile device 'orientation change' event is fired.