window.outerWidth VS $(窗口).outerWidth() [英] window.outerWidth VS $(window).outerWidth()

查看:57
本文介绍了window.outerWidth VS $(窗口).outerWidth()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇window.outerWidth$(window).outerWidth()之间的区别(如果有).

I'm just curious as to what the difference between window.outerWidth and $(window).outerWidth() is, if any.

我在Google上找不到太多关于此的信息,所以我认为我很受大众欢迎.这只是一个普遍的问题,而不是一个特定的问题.

I couldn't really find much info about this on Google, so I thought I'd appeal to the masses. This is just a general question, not a specific issue.

推荐答案

jQuery的externalWidth :

返回元素的宽度以及左右填充, 边框(可选),以像素为单位.

Returns the width of the element, along with left and right padding, border, and optionally margin, in pixels.

如果includeMargin被省略或为false,则填充和边框为 包括在计算中;如果为true,则还包括边距.

If includeMargin is omitted or false, the padding and border are included in the calculation; if true, the margin is also included.

此方法不适用于窗口和文档对象;为了 这些,请改用.width().

This method is not applicable to window and document objects; for these, use .width() instead.

window.outerWidth :

window.outerWidth获取浏览器窗口外部的宽度. 它代表整个浏览器窗口(包括边栏)的宽度 (如果已展开),窗口镶边和窗口大小调整边框/句柄.

window.outerWidth gets the width of the outside of the browser window. It represents the width of the whole browser window including sidebar (if expanded), window chrome and window resizing borders/handles.

这篇关于window.outerWidth VS $(窗口).outerWidth()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆