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 尊渡假赌尊渡假赌尊渡假赌
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
R.E.P.O. Save File Location: Where Is It & How to Protect It?
3 weeks ago
By DDD

Hot tools Tags

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 尊渡假赌尊渡假赌尊渡假赌
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
R.E.P.O. Save File Location: Where Is It & How to Protect It?
3 weeks ago
By DDD

Hot Article Tags

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

Three ways to get thread return value in Python

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

Can a Golang function return multiple values?

Common types of C++ function return value types

C++ function pointer as function return value

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