1.0.2 • Published 7 years ago

offscreen.js v1.0.2

Weekly downloads
9
License
MIT
Repository
github
Last release
7 years ago

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

1.0.2

7 years ago

1.0.1

8 years ago

1.0.0

8 years ago