dom-zindex
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "dom-zindex", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Web common z-index style management", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -36,21 +36,21 @@ # z-index Manager | ||
```javascript | ||
import domZindex from 'dom-zindex' | ||
import domZIndex from 'dom-zindex' | ||
// Gets the largest z-index on the page. | ||
domZindex.getMax() | ||
domZIndex.getMax() | ||
// Set main current z-index. | ||
domZindex.setCurrent(1000) | ||
domZIndex.setCurrent(1000) | ||
// Get main current z-index. | ||
domZindex.getCurrent() // 1000 | ||
domZIndex.getCurrent() // 1000 | ||
// Get main next z-index. | ||
domZindex.getNext() // 1001 | ||
domZIndex.getNext() // 1001 | ||
// Get subordinate current z-index, the secondary z-index will always be greater than the primary z-index. | ||
domZindex.getSubCurrent() // 2001 | ||
domZIndex.getSubCurrent() // 2001 | ||
// Get subordinate next z-index. | ||
domZindex.getSubNext() // 2002 | ||
domZIndex.getSubNext() // 2002 | ||
``` | ||
@@ -61,15 +61,21 @@ | ||
```javascript | ||
import domZindex from 'dom-zindex' | ||
import domZIndex from 'dom-zindex' | ||
// If the incoming z-index is less than global, the next one is automatically fetched. | ||
let currZindex1 = 888 | ||
currZindex1 = domZindex.getCurrent(currZindex1) // 1000 | ||
let currZIndex1 = 888 | ||
currZIndex1 = domZIndex.getCurrent(currZIndex1) // 1000 | ||
// If the z-index is greater than the global value, the value is returned. | ||
let currZindex2 = 2000 | ||
currZindex2 = domZindex.getCurrent(currZindex2) // 1500 | ||
let currZIndex2 = 2000 | ||
currZIndex2 = domZIndex.getCurrent(currZIndex2) // 1500 | ||
``` | ||
## Contributors | ||
Thank you to everyone who contributed to this project. | ||
[![dom-zindex](https://contrib.rocks/image?repo=x-extends/dom-zindex)](https://github.com/x-extends/dom-zindex/graphs/contributors) | ||
## License | ||
[MIT](LICENSE) © 2019-present, Xu Liangzhan |
@@ -36,21 +36,21 @@ # z-index 管理器 | ||
```javascript | ||
import domZindex from 'dom-zindex' | ||
import domZIndex from 'dom-zindex' | ||
// 获取页面中最大的 z-index | ||
domZindex.getMax() | ||
domZIndex.getMax() | ||
// 设置当前 z-index | ||
domZindex.setCurrent(1000) | ||
domZIndex.setCurrent(1000) | ||
// 获取当前 z-index | ||
domZindex.getCurrent() // 1000 | ||
domZIndex.getCurrent() // 1000 | ||
// 获取下一级 z-index | ||
domZindex.getNext() // 1001 | ||
domZIndex.getNext() // 1001 | ||
// 获取次要的当前 z-index,次要的 z-index 始终会大于主要的 z-index | ||
domZindex.getSubCurrent() // 2001 | ||
domZIndex.getSubCurrent() // 2001 | ||
// 获取次要的下一级 z-index | ||
domZindex.getSubNext() // 2002 | ||
domZIndex.getSubNext() // 2002 | ||
``` | ||
@@ -61,11 +61,11 @@ | ||
```javascript | ||
import domZindex from 'dom-zindex' | ||
import domZIndex from 'dom-zindex' | ||
// 如果传入 z-index 小于全局,则自动获取下一个 | ||
let currZindex1 = 999 | ||
currZindex1 = domZindex.getCurrent(currZindex1) // 1000 | ||
let currZIndex1 = 999 | ||
currZIndex1 = domZIndex.getCurrent(currZIndex1) // 1000 | ||
// 如果传入 z-index 大于全局,则返回传入值 | ||
let currZindex2 = 1500 | ||
currZindex2 = domZindex.getCurrent(currZindex2) // 1500 | ||
let currZIndex2 = 1500 | ||
currZIndex2 = domZIndex.getCurrent(currZIndex2) // 1500 | ||
``` | ||
@@ -72,0 +72,0 @@ |
@@ -0,1 +1,4 @@ | ||
// Gets the largest z-index on the page. | ||
export function getMax(): number | ||
/** | ||
@@ -2,0 +5,0 @@ * Set main z-index value |
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
20648
394
80