Socket
Book a DemoInstallSign in
Socket

measure-scrollbar

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

measure-scrollbar

Get the width of the browser scrollbar

1.1.0
latest
Source
npmnpm
Version published
Weekly downloads
4.5K
-24.02%
Maintainers
1
Weekly downloads
 
Created
Source

measure-scrollbar

Get the width of the browser scrollbar

Demo

Installation

$ npm install measure-scrollbar

Usage

import measureScrollbar from 'measure-scrollbar'

measureScrollbar()
// => 15

measureScrollbar() returns the width of the browser scrollbar in pixels.

Module bundlers

measure-scrollbar is primarily distributed as an ES module. Therefore, it works out of the box with webpack, Parcel, and Rollup (even without rollup-plugin-commonjs).

Browserify does not support ES modules natively. To use measure-scrollbar with Browserify, you can require the CommonJS version using require('measure-scrollbar/commonjs').

Browser support

measure-scrollbar supports the latest releases of Chrome, Safari, Firefox, Microsoft Edge, and Opera.

If you require Internet Explorer support, use Babel’s ES2015 arrow functions transform.

Acknowledgments

measure-scrollbar is based on David Walsh’s Detect Scrollbar Width with JavaScript article.

Changelog

This project follows Semantic Versioning 2.

  • v1.1.0 (2018-06-09): Add CommonJS version
  • v1.0.0 (2017-07-25):
    • Fully commit to Semantic Versioning
    • Document official browser support
  • v0.1.0 (2017-06-20): Initial release

Keywords

scrollbar

FAQs

Package last updated on 09 Jun 2018

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.