Home > Web Front-end > HTML Tutorial > Ask an old question_html/css_WEB-ITnose

Ask an old question_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:05:21
Original
1267 people have browsed it


set doc=webbrowser1.document
How to get the size (width and height) of webbrowser1 through this doc?

I use the following method to obtain it. Sometimes it is correct and sometimes it is 0. What is going on?
doc.body.offsetwidth doc.body.offsetheight
doc.documentelement.clientwidth doc.documentelement.clienttheight






Reply to the discussion (solution)

When fetching, it depends on whether the document has been rendered. It is best to get the value in the loaded event.

When fetching, it depends on whether the document has been rendered. It is best to get the value in the loaded event.


During the test, the page had already been loaded.

I don’t need the height and width of the document, only the height and width of the container webbrowser.

Anyone else answered? No more stickers.

My own solution: Since the code is used in the class, setting the width and height of the webbrowser during instantiation can solve the problem.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template