Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //added by JG 3/10/2011, to extend selectors.
- // Example:
- //if ($('#whatever').is(':inView') ) {...}
- jQuery.extend(jQuery.expr[':'], {
- inView: function(a) {
- var st = (document.documentElement.scrollTop || document.body.scrollTop),
- ot = jQuery(a).offset().top,
- wh = (window.innerHeight && window.innerHeight < jQuery(window).height()) ? window.innerHeight : jQuery(window).height();
- return ot > st && (jQuery(a).height() + ot) < (st + wh);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement