All Projects → gijsroge → Offscreen.js

gijsroge / Offscreen.js

Licence: mit
Detects if an element falls of the viewport of your screen

Programming Languages

javascript
184084 projects - #8 most used programming language

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].