Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

height-checker

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

height-checker

Checks the height of DOM elements

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Height Checker

The simple tool that checks height of DOM elements and write console messages if it is not multiplie of specific number.

Usage

  1. Install the package:
> npm install height-checker
  1. Add data-check-height attribute to DOM elements that should be checked:
<div data-check-height="8">
</div>

data-check-height attribute should contain multiplier. If its value is empty, the default value 8 will be used.

  1. Init height checker:
import { initHeightChecker } from 'height-checker';

initHeightChecker();

Also, you can pass log level parameter to the method:

initHeightChecker('info');

Allowed values of log level:

  • log
  • warn
  • info
  • error

The height will be checked on window resize as well as on DOM manipulation. Once element's height is not multiplie of the defined size, you will see error message in browser's console.

License

The project is released under the MIT License.

Keywords

FAQs

Package last updated on 08 Dec 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc