PageSourceSearch

https://kirstenboersma.nl/wp-content/themes/atelier/js/lib/jquery.viewport.js

js kirstenboersma.nl collected 2026-09-25 03:44:18 UTC 1,976 bytes, 58 lines download raw bytes

1/*
2 * Viewport - jQuery selectors for finding elements in viewport
3 *
4 * Copyright (c) 2008-2009 Mika Tuupola
5 *
6 * Licensed under the MIT license:
7 *   http://www.opensource.org/licenses/mit-license.php
8 *
9 * Project home:
10 *  http://www.appelsiini.net/projects/viewport
11 *
12 */
13(function($) {
14
15    $.belowthefold = function(element, settings) {
16        var fold = $(window).height() + $(window).scrollTop();
17        return fold <= $(element).offset().top - settings.threshold;
18    };
19
20    $.abovethetop = function(element, settings) {
21        var top = $(window).scrollTop();
22        return top >= $(element).offset().top + $(element).height() - settings.threshold;
23    };
24
25    $.rightofscreen = function(element, settings) {
26        var fold = $(window).width() + $(window).scrollLeft();
27        return fold <= $(element).offset().left - settings.threshold;
28    };
29
30    $.leftofscreen = function(element, settings) {
31        var left = $(window).scrollLeft();
32        return left >= $(element).offset().left + $(element).width() - settings.threshold;
33    };
34
35    $.inviewport = function(element, settings) {
36        return !$.rightofscreen(element, settings) && !$.leftofscreen(element, settings) && !$.belowthefold(element, settings) && !$.abovethetop(element, settings);
37    };
38
39    $.extend($.expr[':'], {
40        "below-the-fold": function(a, i, m) {
41            return $.belowthefold(a, {threshold : parseInt(m[3]) || 0});
42        },
43        "above-the-top": function(a, i, m) {
44            return $.abovethetop(a, {threshold : parseInt(m[3]) || 0});
45        },
46        "left-of-screen": function(a, i, m) {
47            return $.leftofscreen(a, {threshold : parseInt(m[3]) || 0});
48        },
49        "right-of-screen": function(a, i, m) {
50            return $.rightofscreen(a, {threshold : parseInt(m[3]) || 0});
51        },
52        "in-viewport": function(a, i, m) {
53            return $.inviewport(a, {threshold : parseInt(m[3]) || 0});
54        }
55    });
56
57
58})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.