Skocz do zawartości

Recommended Posts

Napisano (edytowany)
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>

 

Edytowano przez let_Maya

Join the conversation

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

Gość
Odpowiedz...

×   Wkleiłeś zawartość bez formatowania.   Usuń formatowanie

  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.

×
×
  • Utwórz nowe...