Home Web Front-end JS Tutorial Sample code for js function to return multiple return values_javascript skills

Sample code for js function to return multiple return values_javascript skills

May 16, 2016 pm 05:17 PM
return value

复制代码 代码如下:

var w = getClientSize().width;
var h = getClientSize().height - 97;

复制代码 代码如下:

function getClientSize() {
var a = h = 0;
if (window.innerHeight) {
a = window.innerWidth;
h = window.innerHeight
} else {
if (document.documentElement && document.documentElement.clientHeight) {
a = document.documentElement.clientWidth;
h = document.documentElement.clientHeight
} else {
a = document.body.clientWidth;
h = document.body.clientHeight
}
}
return {
width: a,
height: h
};
}
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

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Three ways to get thread return value in Python Three ways to get thread return value in Python Apr 13, 2023 am 10:43 AM

Three ways to get thread return value in Python

How to solve the problem that scanf return value is ignored How to solve the problem that scanf return value is ignored Nov 14, 2023 am 10:01 AM

How to solve the problem that scanf return value is ignored

Use Java's Math.min() function to compare the size of two numbers and return the smaller value Use Java's Math.min() function to compare the size of two numbers and return the smaller value Jul 25, 2023 pm 01:21 PM

Use Java's Math.min() function to compare the size of two numbers and return the smaller value

Can a Golang function return multiple values? Can a Golang function return multiple values? Apr 13, 2024 pm 02:42 PM

Can a Golang function return multiple values?

Common types of C++ function return value types Common types of C++ function return value types Apr 12, 2024 pm 05:36 PM

Common types of C++ function return value types

C++ function pointer as function return value C++ function pointer as function return value Apr 14, 2024 am 08:30 AM

C++ function pointer as function return value

PHP returns the key name currently pointed to by the internal pointer of the array PHP returns the key name currently pointed to by the internal pointer of the array Mar 21, 2024 pm 04:21 PM

PHP returns the key name currently pointed to by the internal pointer of the array

How to use return value in Python How to use return value in Python Oct 07, 2023 am 11:10 AM

How to use return value in Python

See all articles