PageSourceSearch

https://www.peika.bg/_javascript/animate-bg.js

js peika.bg collected 2026-10-02 13:03:00 UTC 2,357 bytes, 61 lines download raw bytes

1/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
2* Licensed under the MIT License (LICENSE.txt).
3*/
4
5
6(function($) {
7    // backgroundPosition[X,Y] get hooks
8    var $div = $('<div style="background-position: 3px 5px">');
9    $.support.backgroundPosition = $div.css('backgroundPosition') === "3px 5px" ? true : false;
10    $.support.backgroundPositionXY = $div.css('backgroundPositionX') === "3px" ? true : false;
11    $div = null;
12
13    var xy = ["X","Y"];
14
15    // helper function to parse out the X and Y values from backgroundPosition
16    function parseBgPos(bgPos) {
17        var parts = bgPos.split(/\s/),
18            values = {
19                "X": parts[0],
20                "Y": parts[1]
21            };
22        return values;
23    }
24
25    if (!$.support.backgroundPosition && $.support.backgroundPositionXY) {
26        $.cssHooks.backgroundPosition = {
27            get: function( elem, computed, extra ) {
28                return $.map(xy, function( l, i ) {
29                    return $.css(elem, "backgroundPosition" + l);
30                }).join(" ");
31            },
32            set: function( elem, value ) {
33                $.each(xy, function( i, l ) {
34                    var values = parseBgPos(value);
35                    elem.style[ "backgroundPosition" + l ] = values[ l ];
36                });
37            }
38        };
39    }
40
41    if ($.support.backgroundPosition && !$.support.backgroundPositionXY) {
42        $.each(xy, function( i, l ) {
43            $.cssHooks[ "backgroundPosition" + l ] = {
44                get: function( elem, computed, extra ) {
45                    var values = parseBgPos( $.css(elem, "backgroundPosition") );
46                    return values[ l ];
47                },
48                set: function( elem, value ) {
49                    var values = parseBgPos( $.css(elem, "backgroundPosition") ),
50                        isX = l === "X";
51                    elem.style.backgroundPosition = (isX ? value : values[ "X" ]) + " " +
52                                                    (isX ? values[ "Y" ] : value);
53                }
54            };
55            $.fx.step[ "backgroundPosition" + l ] = function( fx ) {
56                $.cssHooks[ "backgroundPosition" + l ].set( fx.elem, fx.now + fx.unit );
57            };
58        });
59    }
60})(jQuery);
61

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.