PageSourceSearch

https://cbe.org.za/webmodules/common/js/zoom.js

js cbe.org.za collected 2026-10-06 02:07:06 UTC 1,978 bytes, 53 lines download raw bytes

1/*
2 Author: Jafar Akhondali
3 Release year: 2016
4 Title:	Light-Zoom JQuery plugin that use pure css to zoom on images, this enables you to zoom without loading bigger image and zoom even on gif images !
5 https://github.com/JafarAkhondali/lightzoom
6 */
7$.fn.lightzoom = function (a) {
8    a = $.extend({
9        zoomPower: 3,
10        glassSize: 175
11    }, a);
12    var l = a.glassSize / 2,
13        m = a.glassSize / 4,
14        n = a.zoomPower;
15    $("body").append('<div id="glass"></div>');
16    $("html > head").append($("<style> #glass{width: " + a.glassSize + "px; height: " + a.glassSize + "px;}</style>"));
17    var k;
18    $("#glass").mousemove(function (a) {
19        var c = this.targ;
20        a.target = c;
21        k(a, c)
22    });
23    this.mousemove(function (a) {
24        k(a, this)
25    });
26    k = function (a, c) {
27
28        if ($("#glass").length > 0) {
29
30            document.getElementById("glass").targ = c;
31			i =  $(c).prop("nodeName") != "IMG" ? $(c).css('background-image') : " url('" +$(c).attr('src')+ "')"
32			
33            var d = a.pageX,
34                e = a.pageY,
35                g = c.offsetWidth,
36                h = c.offsetHeight,
37                b = $(c).offset(),
38                f = b.left,
39                b = b.top;
40            d > f && d < f + g && b < e && b + h > e ? (offsetXfixer = (d - f - g / 2) / (g / 2) * m, offsetYfixer = (e - b - h / 2) / (h / 2) * m, f = (d - f + offsetXfixer) / g * 100, b = (e - b + offsetYfixer) / h * 100, e -= l, d -= l, $("#glass").css({
41                top: e,
42                left: d,
43                "background-image": i,
44                "background-size": g * n + "px " + h * n + "px",
45                "background-position": f + "% " + b + "%",
46                display: "inline-block"
47            }), $("body").css("cursor", "default")) : ($("#glass").css("display", "none"), $("body").css("cursor", "default"))
48
49        }
50        
51    };
52    return this
53};

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.