Socket
Socket
Sign inDemoInstall

dom-zindex

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dom-zindex

Web common z-index style management


Version published
Weekly downloads
7.9K
decreased by-1.39%
Maintainers
1
Install size
19.9 kB
Created
Weekly downloads
 

Readme

Source

z-index Manager

English | 简体中文

npm version npm downloads issues issues closed pull requests pull requests closed npm license

Web common z-index style management.

Browser Support

IEEdgeChromeFirefoxOperaSafari
7+ ✔80+ ✔44+ ✔40+ ✔60+ ✔6+ ✔

Installing

npm install dom-zindex

CDN

<script src="https://unpkg.com/dom-zindex"></script>

Example 1

import domZindex from 'dom-zindex'

// Gets the largest z-index on the page.
domZindex.getMax()

// Set main current z-index.
domZindex.setCurrent(1000)

// Get main current z-index.
domZindex.getCurrent() // 1000

// Get main next z-index.
domZindex.getNext() // 1001

// Get subordinate current z-index, the secondary z-index will always be greater than the primary z-index.
domZindex.getSubCurrent() // 2001

// Get subordinate next z-index.
domZindex.getSubNext() // 2002

Example 2

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

// If the z-index is greater than the global value, the value is returned.
let currZindex2 = 2000
currZindex2 = domZindex.getCurrent(currZindex2) // 1500

License

MIT © 2019-present, Xu Liangzhan

Keywords

FAQs

Last updated on 23 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc