🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

offscreen.js

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

offscreen.js

Detects if an element falls of the viewport of your screen.

1.0.2
latest
Source
npm
Version published
Maintainers
1
Created
Source

offscreen.js

Detects if an element (tooltip) falls of the right/left/top/bottom side of your screen/viewport

demo

What does it do?

Adds a class to all your elements with the defined selector that fall of the right/left/top/bottom side of the screen.

  • checks all the elements with the defined selector.
  • rechecks everything when resize (optimized resize)
  • customize classes

Usage:

$( document ).ready(function() {
  $('.tooltip__content').offscreen({
    rightClass: 'right-edge',
    leftClass: 'left-edge',
    topClass: 'top-edge',
    bottomClass: 'bottom-edge',
    widthOffset: 40, //px value
    smartResize: true
  });
});   

Requires:

jQuery

@GijsRoge

FAQs

Package last updated on 24 May 2017

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