PageSourceSearch

https://mmchospital.co.id/assets/js/element-in-view.js

js mmchospital.co.id collected 2026-10-07 20:33:24 UTC 1,492 bytes, 42 lines download raw bytes

1(function($) {
2
3  /**
4   * Copyright 2012, Digital Fusion
5   * Licensed under the MIT license.
6   * http://teamdf.com/jquery-plugins/license/
7   *
8   * @author Sam Sehnert
9   * @desc A small plugin that checks whether elements are within
10   *     the user visible viewport of a web browser.
11   *     only accounts for vertical position, not horizontal.
12   */
13
14  $.fn.visible = function(partial) {
15
16      var $t            = $(this),
17          $w            = $(window),
18          viewTop       = $w.scrollTop(),
19          viewBottom    = viewTop + $w.height(),
20          _top          = $t.offset().top,
21          _bottom       = _top + $t.height(),
22          compareTop    = partial === true ? _bottom : _top,
23          compareBottom = partial === true ? _top : _bottom;
24
25    return ((compareBottom <= viewBottom) && (compareTop >= viewTop));
26
27  };
28
29})(jQuery);
30
31$(window).on('scroll', function() {
32
33  $(".testimonial-author .author-one, .testimonial-author .author-two, .testimonial-author .author-three,  .testimonial-author .author-four,  .testimonial-author .author-five, .testimonial-avatar .avatar-one, .testimonial-avatar .avatar-two, .testimonial-avatar .avatar-three, .testimonial-avatar .avatar-four, .testimonial-avatar .avatar-five, .testimonial-avatar .avatar-six").each(function(i, el) {
34    var el = $(el);
35    if (el.visible(true)) {
36      el.addClass("now-in-view");
37    } else {
38      el.removeClass("now-in-view");
39    }
40  });
41
42});

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.