## 1.創建一個元素
~~~
var $item =$("<div class='one'></div>")
~~~
## 2.獲取頁面某一元素的絕對X,Y坐標,可以用offset():
```
var X = $(‘#DivID’).offset().top;
var Y = $(‘#DivID’).offset().left;
```
## 3.判斷元素是否到達頁面底部
~~~
function isReachBottom() {
var dh = $(document).height();
var wh = $(window).height();
var sh = $(window).scrollTop();
return (dh == Math.ceil(wh+sh))? true : false;
}
~~~
## 4.獲取可視區域的高度
```
var wh = $(window).height();
//var winHeight = window.innerHeight;
var winHeight = document.documentElement.clientHeight;
console.log(winHeight)
console.log(wh)
```
## 5.滾動條距離頂部的高度
~~~
var scrollH = document.documentElement.scrollTop;
var sh = $(window).scrollTop();
console.log(scrollH)
~~~
## 6.文檔的高度
```
var dh = $(document).height()
var docH = document.body.scrollHeight;