Skip to content

Instantly share code, notes, and snippets.

@ashhitch
Created January 4, 2018 12:56
Show Gist options
  • Select an option

  • Save ashhitch/90b035e386237083955a21f7522b4b77 to your computer and use it in GitHub Desktop.

Select an option

Save ashhitch/90b035e386237083955a21f7522b4b77 to your computer and use it in GitHub Desktop.
get Hidden Element Dimensions
getHiddenElementDimensions( element: any ): any {
let dimensions: any = {};
element.style.visibility = 'hidden';
element.style.display = 'block';
dimensions.width = element.offsetWidth;
dimensions.height = element.offsetHeight;
element.style.display = 'none';
element.style.visibility = 'visible';
return dimensions;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment