Jump to content

Replacing jQuery .outerHeight() with Javascript Pin


let_Maya
 Share

Recommended Posts

React
I am working on replacing this jQuery code written in Typescript into Vanilla JavaScript for edit .pdf purposes. I have problem resizing the window. Replacing .outerHeight() with offsetHeight doesn't work
 
windowResizeHandler: () => void = () => {
		let body = document.querySelector("body");
		let height = parseInt(window.getComputedStyle(body).height);
		//suppose there is a #header element which takes some area.

		let headHeight = $("#header").outerHeight();
		let rightHeight = height;
		if ($("#header").is(":visible")) {
			rightHeight = height - headHeight;
		}
		$("#right").height(rightHeight);
		WebPDF.updateLayer();

HTML

 

<page-container>
		<div id="docViewer" ref="docViewer" style="background: #dddedf;"></div>
	</page-container>

 

Edited by let_Maya
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...