Comparing version 0.7.21 to 0.8.1
@@ -59,2 +59,3 @@ febs 库是一些常用的工具的合集; | ||
- [dom](#dom) | ||
- [utils](#utils) | ||
@@ -85,3 +86,18 @@ - [string](#string) | ||
# dom | ||
```js | ||
/** | ||
* @desc: 获得视口大小. | ||
* @return: {width, height} | ||
*/ | ||
febs.dom.getViewPort():{width:number, height:number}; | ||
/** | ||
* @desc: 获得文档大小. | ||
* @return: {width, height} | ||
*/ | ||
febs.dom.getDocumentPort():{width:number, height:number}; | ||
``` | ||
# utils | ||
@@ -88,0 +104,0 @@ |
@@ -1409,4 +1409,41 @@ ( function( global, factory ) { | ||
/** | ||
* @desc: viewport. | ||
* @return: {width, height} | ||
*/ | ||
Dom.getViewPort = function() { | ||
if(window.document.compatMode == "BackCompat") { //浏览器嗅探,混杂模式 | ||
return { | ||
width: window.document.body.clientWidth, | ||
height: window.document.body.clientHeight | ||
}; | ||
} else { | ||
return { | ||
width: window.document.documentElement.clientWidth, | ||
height: window.document.documentElement.clientHeight | ||
}; | ||
} | ||
} | ||
/** | ||
* @desc: documentport. | ||
* @return: {width, height} | ||
*/ | ||
Dom.getDocumentPort = function() { | ||
if(window.document.compatMode == "BackCompat") { | ||
return { | ||
width: window.document.body.scrollWidth, | ||
height: window.document.body.scrollHeight | ||
}; | ||
} else { | ||
return { | ||
width: Math.max(window.document.documentElement.scrollWidth,window.document.documentElement.clientWidth), | ||
height: Math.max(window.document.documentElement.scrollHeight,window.document.documentElement.clientHeight) | ||
} | ||
} | ||
} | ||
return {Dom, CreateDom}; | ||
} | ||
); |
@@ -58,2 +58,3 @@ | ||
febs['$'] = febs.dom.CreateDom; | ||
febs.dom = febs.dom.Dom; | ||
@@ -60,0 +61,0 @@ window['febs'] = febs; |
@@ -59,2 +59,3 @@ febs 库是一些常用的工具的合集; | ||
- [dom](#dom) | ||
- [utils](#utils) | ||
@@ -85,3 +86,18 @@ - [string](#string) | ||
# dom | ||
```js | ||
/** | ||
* @desc: 获得视口大小. | ||
* @return: {width, height} | ||
*/ | ||
febs.dom.getViewPort():{width:number, height:number}; | ||
/** | ||
* @desc: 获得文档大小. | ||
* @return: {width, height} | ||
*/ | ||
febs.dom.getDocumentPort():{width:number, height:number}; | ||
``` | ||
# utils | ||
@@ -88,0 +104,0 @@ |
@@ -483,2 +483,17 @@ // Type definitions for febs | ||
export namespace dom { | ||
/** | ||
* @desc: 获得视口大小. | ||
* @return: {width, height} | ||
*/ | ||
function getViewPort():{width:number, height:number};; | ||
/** | ||
* @desc: 获得文档大小. | ||
* @return: {width, height} | ||
*/ | ||
function getDocumentPort():{width:number, height:number};; | ||
} | ||
declare global { | ||
@@ -485,0 +500,0 @@ export function $(n:any):dom; |
@@ -72,1 +72,5 @@ | ||
- [feature] add sha1, md5 in crypt. use uuid module for crypt.uuid | ||
0.8.1 | ||
================== | ||
- [feature] add dom.getViewPort dom.getDocumentPort. |
@@ -86,3 +86,3 @@ { | ||
"name": "febs", | ||
"version": "0.7.21" | ||
"version": "0.8.1" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1688015
17246