Answers for "js fit window to content"

0

js fit window to content

/* fit the window size to match the content wrapper */
function fitWindow2Content( contentWrapper ) {
  
	// calculate necessary change in window's width
	var width = window.innerWidth - contentWrapper.clientWidth;

	// calculate necessary change in window's height
	var height = window.innerHeight- contentWrapper.clientHeight;
  
  	// resize window to fit content
	window.resizeBy( -width , -height );

}
Posted by: Guest on December-12-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language