Socket
Socket
Sign inDemoInstall

breakpoints.js

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    breakpoints.js

Fire custom events when the browser enters and/or exits breakpoints


Version published
Weekly downloads
2
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Breakpoints.js

Define breakpoints for one or multiple targets on your page, and Breakpoints.js will fire custom events on the targets when their size enters and/or exits a specific breakpoint.

Breakpoints.js Demo

Usage

Installation

npm install breakpoints.js

Initialize

var breakpoints = new Breakpoints('body', {
	breakpoints: [320, 480, 768, 1024],
	distinct: true,
	interval: 250
});

Destroy

// You can also get the Breakpoints.js instance from data
var breakpoints = $('body').data('breakpoints');

// Destroy
breakpoints.destroy()

Events

$('body').on('enterBreakpoint320', function() {
	...
});
	
$('body').on('exitBreakpoint320', function() {
	...
});

Keywords

FAQs

Last updated on 04 May 2016

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