Fixed javascript for screen element for fetching its area