PageSourceSearch

https://www.nriag.sci.eg/wp-content/plugins/pj-news-ticker/public/js/pj-news-ticker.js?ver=1.9.8

js nriag.sci.eg collected 2026-09-24 21:22:04 UTC 3,023 bytes, 72 lines download raw bytes

1/**
2 * PJ News Ticker - starts the marquee animation on all elements of class="pjnt-content"
3 */
4
5(function ($) {
6    $.fn.pjntinit = function () {
7        var ifPresent = parseInt($(this).parent().width());
8        // if the ticker is not present (using CSS) on the page do not run
9        if (ifPresent !== 0) {
10            return this.each(function () {
11                var originalHtml = $(this).html();
12                var originalWidth = parseInt($(this).width());
13                var containerWidth = parseInt($(this).parent().width());
14
15                var hasGap = $(this).data('gap');
16                if (hasGap === false && containerWidth > 0) {
17                    // we need to repeat at least once..
18                    $(this).append(originalHtml);
19                    // then repeat again until the total content is wide enough
20                    while (parseInt($(this).width()) < (containerWidth + originalWidth)) {
21                        $(this).append(originalHtml);
22                    }
23                }
24                $(this).bind('pjnt-start', function (event, c) {
25                    var contentLeft = parseInt($(this).css('left'));
26                    if (contentLeft <= -originalWidth) {
27                        // wrapped around, restart
28                        var newLeft = containerWidth;
29                        if (hasGap === false && this.typeof !== 'undefined') {
30                            newLeft = contentLeft + originalWidth;
31                        } else {
32                            newLeft = 0;
33                        }
34
35                        $(this).css({left: newLeft + 'px'});
36                        contentLeft = newLeft;
37                    } else {
38                        // resume
39                    }
40                    var speed = $(this).data('speed'); // pixels per second
41                    var toGo = Math.ceil(originalWidth + contentLeft); // how many pixels we will be moving
42                    var duration = (toGo / speed) * 1000; // duration in milliseconds
43                    // do the animation, and start another one when finished
44                    $(this).animate({left: '-' + originalWidth + 'px'}, duration, 'linear', function () {
45                        $(this).trigger('pjnt-start');
46                    });
47                });
48
49                // start the animation now
50                $(this).trigger('pjnt-start');
51
52                // stop on mouse over
53                $(this).mouseover(function () {
54                    $(this).stop();
55                });
56                // start again on mouse out
57                $(this).mouseout(function () {
58                    $(this).trigger('pjnt-start');
59                });
60
61
62            });
63        }
64    };
65}(jQuery));
66
67jQuery(document).ready(function ($) {
68    // wait for fonts to load, to ensure correct width() calc
69    $(window).bind("load", function () {
70        $('.pjnt-content').pjntinit();
71    });
72});

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.