


Javascript obtains the size and position parameters of the window (container) enumeration and brief description_Basic knowledge
Javascript obtains the size and position of the window (container). There are many things, which are easy to confuse. Here is a list and brief description:
Attribute method description:
clientX relative documentation The horizontal coordinate of The scroll height;
scrollLeft sets or gets the distance between the left edge of the object and the leftmost end of the currently visible content in the window;
scrollTop sets or gets the distance between the topmost edge of the object and the topmost visible content in the window distance;
offsetWidth gets the width of the object relative to the layout or the parent coordinate specified by the parent coordinate offsetParent property;
offsetHeight gets the height of the object relative to the layout or the parent coordinate specified by the parent coordinate offsetParent property;
offsetLeft gets the calculated left position of the object relative to the layout or the parent coordinate specified by the offsetParent attribute;
offsetTop gets the calculated top position of the object relative to the layout or the parent coordinate specified by the offsetTop attribute.
Javascript method to obtain screen and window size
:
Height of screen resolution: window.screen.height;
Width of screen resolution: window.screen.width;
Height of screen available work area (excluding the taskbar): window.screen.availHeight; Width of the available work area of the screen (excluding the taskbar): window.screen.availWidth; Width of the visible area of the web page (excluding scroll bars and borders): document.body.clientWidth;
The height of the visible area of the web page (excluding scroll bars and borders): document.body.clientHeight;
The width of the visible area of the web page (including scroll bars and borders): document.body.offsetWidth;
Height of the visible area of the web page (including scroll bars and borders): document.body.offsetHeight;
Web page body width: document.body.scrollWidth;
Web page body height: document.body.scrollHeight;
Web page The height to be scrolled: document.body.scrollTop;
The left side to be scrolled: document.body.scrollLeft;
On the body of the web page (the distance between the leftmost side of the web page and the left edge of the screen): window. screenTop;
Left of the text part of the webpage (the distance between the top of the text of the webpage and the upper edge of the screen): window.screenLeft.
Note: Sometimes the value cannot be obtained because of html The document type
is added to the file header:
, At this time, document.body.scrollTop and document.body.scrollLeft are changed to: document.documentElement.scrollTop and document.documentElement.scrollLeft is enough, document.body.clientWidth and document.body.clientHeight should also be changed to: document.documentElement.clientWidth and document.documentElement.clientHeight
Of course there are omissions or lack of explanation. Everyone can add, discuss or Baidu Baidu to make progress together! ye~

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The environment variable function is an essential tool for running the configuration program in the system. However, in the latest win11 system, there are still many users who do not know how to set it up. Here is a detailed introduction to the location of the win11 environment variable opening. Come and join us. Learn to operate it. Where are the win11 environment variables: 1. First enter "win+R" to open the run box. 2. Then enter the command: controlsystem. 3. In the system information interface that opens, select "Advanced System Settings" from the left menu. 4. Then select the "Environment Variables" option at the bottom of the "System Properties" window that opens. 5. Finally, in the opened environment variables, you can make relevant settings according to your needs.

Every Windows system has a startup path. If you add files or software to it, it will be opened at boot time. However, many friends don’t know where the win11 startup path is. In fact, we only need to enter the corresponding folder on the C drive. Win11 startup path: 1. Double-click to open "This PC" 2. Directly paste the path "C:\ProgramData\Microsoft\Windows\StartMenu\Programs\Startup" into the path box. 3. Here is the win11 startup path. If we want to open the file after booting, we can put the file in. 4. If you cannot enter according to this path, it may be hidden.

Steam is one of the most popular applications among PC gamers as you can find any major game on the Steam store. It simplifies the downloading, installation and management of users' favorite games through its user interface. Whenever a Steam user wants to download a game, Steam uses the application's default installation directory to download and install the game. This location defaults to C:\ProgramFiles(x86)\Steam. The problem arises because most users do not have enough space on the C drive, especially for games that take up a lot of storage space, such as 50–100GB. To overcome this problem, Steam allows users to use an app to change the download and

The Credential Manager is a function used by users to manage web credentials and Windows credentials, but many users still don’t know where the Windows 10 Credential Manager is. In fact, the credential manager is on the operation panel. After opening the control panel, remember to change the viewing method to a small icon, so that you can see the credential manager. Click View to view all kinds of information. If you want to view a large amount of , you need to enter the account password. Where is the Windows 10 Credential Manager: 1. Open the Control Panel in the system, click the View method in the upper right corner, and convert the type to a small icon. 2. After viewing it as a small icon, click "Certificate Manager". 3. After entering the credential manager, you can see an introduction to the relevant functions, which are mainly used for

There are a total of 20 origami birds in Croaker Film and Television Park on Star Dome Railway. Many players don’t know where the origami birds are in Crocker Film and Television Park. The editor has summarized the locations of each origami bird to help everyone. Search for it, and take a look at this latest summary of the locations of the origami birds in Croaker Film and Television Park for specific content. Guide to the Honkai Star Dome Railway: Origami Bird in Crook Movie Park Location 1, Crook Movie Park 1st Floor 2, and Crook Movie Park 2nd Floor Star Dome Railway

To learn more about the storage location of packages installed by pip, you need specific code examples. Pip is a commonly used package management tool in the Python language. It is used to easily install, upgrade and manage Python packages. When using pip to install a package, it will automatically download the corresponding package file from PyPI (Python Package Index) and install it to the specified location. So, where are the packages installed by pip stored? This is a problem that many Python developers will encounter. This article will delve into the location of the packages installed by pip and provide
![How to increase disk size in VirtualBox [Guide]](https://img.php.cn/upload/article/000/887/227/171064142025068.jpg?x-oss-process=image/resize,m_fill,h_207,w_330)
We often encounter situations where the predefined disk size has no room for more data? If you need more virtual machine hard disk space at a later stage, you must expand the virtual hard disk and partitions. In this post, we will see how to increase disk size in VirtualBox. Increasing the disk size in VirtualBox It is important to note that you may want to back up your virtual hard disk files before performing these operations, as there is always the possibility of something going wrong. It is always a good practice to have backups. However, the process usually works fine, just make sure to shut down your machine before continuing. There are two ways to increase disk size in VirtualBox. Expand VirtualBox disk size using GUI using CL

If we are going to be away from the computer for a long time, it is best to shut down the computer to protect it. So where is the shutdown in win11? In fact, generally speaking, just open the start menu and you can find the shutdown button in it. Where to shut down Windows 11: Answer: In the power button of the start menu. 1. First, we click the "Windows Logo" on the bottom taskbar to open the "Start Menu" 2. After opening, you can find the "Power" button in the lower right corner, as shown in the figure. 3. After clicking the power button, you will see "Shutdown", click it to shut down. 4. If the computer cannot be shut down due to special circumstances such as a crash, you can directly press and hold the "power button" on the computer to force a shutdown.
