Download
User Rating: 0.1/5 ( 1 votes)
offscreen.js is a jquery plugin that detects if an element (tooltip) falls of the right/left side of your screen/viewport
What does it do?
Adds a class to all your elements with the defined selector that fall of the right/left side of the screen.
-
checks all the elements with the defined selector.
-
rechecks everything when resize (optimized resize)
-
smartresize to increase performance
-
customize classes
Source: gijsroge.github.io
1. INCLUDE JS FILES
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="offscreen.js" type="text/javascript"></script>
2. HTML
<div class="tooltip"> hover
<div class="tooltip__content">
<h3>Tooltip</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</div>
</div>
3. JAVASCRIPT
$( document ).ready(function() {
$('.tooltip__content').offscreen({
smartResize: true,
rightClass: 'right-edge',
leftClass: 'left-edge'
});
});