宽和高

一、css('height') 和 .height()之间的区别是后者返回一个没有单位的数值,前者是返回带有完整单位的字符串。当一个元素的高度需要数学计算的时候推荐使用.height() 方法 。
1、.Height() =height;
2、.innerHeight() = height+padding;
3、.outerHeight() = height+padding+border;
4、.outerHeight(true) =height+padding+border+margin;

二、jq里有关 scroll
$("div").scrollLeft() //获取滚动条距离左边的距离
$("div").scrollLeft(100)//设置滚动物权法距离右的距离,而且不会有滚动动画。

js

window.screen.availWidth 返回当前屏幕宽度(不包括系统自带的任务栏)
window.screen.availHeight 返回当前屏幕高度(不包括系统自带的任务栏)
window.screen.width 返回当前屏幕宽度(分辨率值)
window.screen.height 返回当前屏幕高度(分辨率值)
window.document.body.offsetHeight; 返回当前网页高度 offsetHeight=height+padding+border
window.document.body.offsetWidth; 返回当前网页宽度

原文地址:https://www.cnblogs.com/hyx626/p/9882373.html