PageSourceSearch

https://www.franklincountyymca.org/wp-content/plugins/divi-modules…/modules/BeforeAfter/custom.js?ver=1.2.4

js franklincountyymca.org collected 2026-10-04 13:31:49 UTC 4,439 bytes, 79 lines download raw bytes

1jQuery(function(e) {
2    e.fn.dmpro_before_after_slider = function() {
3        const t = e(this),
4            i = e.extend({
5                default_offset_pct: .5,
6                orientation: "horizontal",
7                before_label: !1,
8                after_label: !1,
9                move_slider_on_hover: !1,
10                move_with_handle_only: !1,
11                click_to_move: !0
12            }, t.data("options"));
13        var r = i.offset / 100,
14            o = "vertical" === i.direction ? "down" : "left",
15            a = "vertical" === i.direction ? "up" : "right";
16        const n = e(`<div class="dmpro_before_after_slider_wrapper dmpro_before_after_slider_${i.direction}"></div>`),
17            c = e(`<img src="${i.before_image}" alt="${i.before_image_alt}" class="dmpro_before_after_slider_before"/>`);
18        n.append(c);
19        const s = e(`<img src="${i.after_image}" alt="${i.after_image_alt}" class="dmpro_before_after_slider_after"/>`);
20        n.append(s), c.on("load", function() {
21            h(r)
22        });
23        const d = e("<div class='dmpro_before_after_slider_overlay'></div>"),
24            l = e(`<div class='dmpro_before_after_slider_before_label dmpro_before_after_slider_label' data-content="${i.before_label}"></div>`),
25            _ = e(`<div class='dmpro_before_after_slider_after_label dmpro_before_after_slider_label' data-content="${i.after_label}"></div>`);
26        d.append(l), d.append(_), n.append(d);
27        const f = e("<div class='dmpro_before_after_slider_handle'></div>");
28        f.append(`<span class="dmpro_before_after_slider_${o}_arrow"></span>`), f.append(`<span class="dmpro_before_after_slider_${a}_arrow"></span>`), n.append(f), t.html(n);
29        var p = function(a) {
30            let t = Math.ceil( e( c[0] ).width() ),
31                i = Math.ceil( e( c[0] ).height() );
32				
33            return {
34                mh: Math.floor( e( c[0] ).height() ),
35                w: t + "px",
36                h: i + "px",
37                cw: Math.ceil(a * t) + "px",
38                ch: Math.ceil(a * i) + "px"
39            }
40        };
41
42        function h(e) {
43            const t = p(e);
44            "vertical" === i.direction ? f.css("top", t.ch) : f.css("left", t.cw),
45                function(e) {
46                    "vertical" === i.direction ? (c.css("clip", `rect(0, ${e.w}, ${e.ch}, 0)`), s.css("clip", `rect(${e.ch}, ${e.w}, ${e.h}, 0)`), l.css("clip", `rect(0, ${e.w}, ${e.ch}, 0)`), _.css("clip", `rect(${e.ch}, ${e.w}, ${e.h}, 0)`)) : (c.css("clip", `rect(0, ${e.cw}, ${e.h}, 0)`), s.css("clip", `rect(0, ${e.w}, ${e.h}, ${e.cw})`), l.css("clip", `rect(0, ${e.cw}, ${e.h}, 0)`), _.css("clip", `rect(0, ${e.w}, ${e.h}, ${e.cw})`)), n.css("height", e.h)
47                }(t)
48        }
49        var v = function(e, t) {
50                var r, o, a, n = "vertical" === i.direction ? (t - u) / $ : (e - m) / b;
51                return r = n, o = 0, a = 1, Math.max(o, Math.min(a, r))
52            },
53            m = 0,
54            u = 0,
55            b = 0,
56            $ = 0,
57            w = function(e) {
58                (e.distX > e.distY && e.distX < -e.distY || e.distX < e.distY && e.distX > -e.distY) && "vertical" !== i.direction ? e.preventDefault() : (e.distX < e.distY && e.distX < -e.distY || e.distX > e.distY && e.distX > -e.distY) && "vertical" === i.direction && e.preventDefault(), t.addClass("active"), m = t.offset().left, u = t.offset().top, b = c.width(), $ = c.height()
59            },
60            g = function(e) {
61                t.hasClass("active") && h(r = v(e.pageX, e.pageY))
62            },
63            X = function() {
64                t.removeClass("active")
65            },
66            Y = i.move_with_handle_only ? f : t;
67        Y.on("movestart", w), Y.on("move", g), Y.on("moveend", X), i.move_slider_on_hover && (t.on("mouseenter", w), t.on("mousemove", g), t.on("mouseleave", X)), f.on("touchmove", function(e) {
68            e.preventDefault()
69        }), t.find("img").on("mousedown", function(e) {
70            e.preventDefault()
71        }), i.click_to_move && t.on("click", function(e) {
72            m = t.offset().left, u = t.offset().top, b = c.width(), $ = c.height(), h(r = v(e.pageX, e.pageY))
73        }), h(r), e(window).on("resize", function() {
74            h(r)
75        })
76    }, e(".dmpro_before_after_slider").each(function() {
77        e(this).find(".dmpro_before_after_slider_container").dmpro_before_after_slider()
78    })
79});

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.