PageSourceSearch

https://www.cohnlg.com/wp-content/plugins/blog-designer/public/js/ticker.min.js

js cohnlg.com collected 2026-09-25 03:58:35 UTC 8,080 bytes, 104 lines download raw bytes

1! function(x) {
2    "use strict";
3    x.breakingNews = function(e, t) {
4        var s = { effect: "scroll", direction: "ltr", height: 40, fontSize: "default", themeColor: "default", background: "default", borderWidth: 1, radius: 2, source: "html", play: !0, delayTimer: 4e3, scrollSpeed: 2, stopOnHover: !0, position: "auto", zIndex: 99999 },
5            a = this;
6        a.settings = {};
7
8        function l() { var e; "scroll" === a.settings.effect && (e = 0, p.each(function() { e += x(this).outerWidth() }), e += 10, f.css({ width: e })) }
9
10        function i() { "rtl" === a.settings.direction ? f.stop().animate({ marginRight: -f.find("li:first-child").outerWidth() }, 300, function() { f.find("li:first-child").insertAfter(f.find("li:last-child")), f.css({ marginRight: 0 }), w = !0 }) : f.stop().animate({ marginLeft: -f.find("li:first-child").outerWidth() }, 300, function() { f.find("li:first-child").insertAfter(f.find("li:last-child")), f.css({ marginLeft: 0 }), w = !0 }) }
11
12        function n() { "rtl" === a.settings.direction ? (0 <= parseInt(f.css("marginRight"), 10) && (f.css({ "margin-right": -f.find("li:last-child").outerWidth() }), f.find("li:last-child").insertBefore(f.find("li:first-child"))), f.stop().animate({ marginRight: 0 }, 300, function() { w = !0 })) : (0 <= parseInt(f.css("marginLeft"), 10) && (f.css({ "margin-left": -f.find("li:last-child").outerWidth() }), f.find("li:last-child").insertBefore(f.find("li:first-child"))), f.stop().animate({ marginLeft: 0 }, 300, function() { w = !0 })) }
13        var c = x(e),
14            e = e,
15            d = c.children(".ticker-title"),
16            f = c.children(".blog-tickers").children("ul"),
17            p = f.children("li"),
18            r = c.children(".blog-ticker-controls"),
19            g = r.find(".blog-ticker-arrow-prev").parent(),
20            u = r.find(".wpos-action").parent(),
21            h = r.find(".blog-ticker-arrow-next").parent(),
22            m = !1,
23            w = !0,
24            k = f.children("li").length,
25            o = 0,
26            v = !1,
27            y = function() {
28                var e = parseFloat(f.css("marginLeft"));
29                e -= a.settings.scrollSpeed / 2, f.css({ marginLeft: e }), e <= -f.find("li:first-child").outerWidth() && (f.find("li:first-child").insertAfter(f.find("li:last-child")), f.css({ marginLeft: 0 })), !1 === m && (window.requestAnimationFrame && requestAnimationFrame(y) || setTimeout(y, 16))
30            },
31            b = function() {
32                var e = parseFloat(f.css("marginRight"));
33                e -= a.settings.scrollSpeed / 2, f.css({ marginRight: e }), e <= -f.find("li:first-child").outerWidth() && (f.find("li:first-child").insertAfter(f.find("li:last-child")), f.css({ marginRight: 0 })), !1 === m && (window.requestAnimationFrame && requestAnimationFrame(b) || setTimeout(b, 16))
34            },
35            C = function() {
36                switch (w = !0, a.settings.effect) {
37                    case "typography":
38                        f.find("li").hide(), f.find("li").eq(o).width(30).show(), f.find("li").eq(o).animate({ width: "100%", opacity: 1 }, 1500);
39                        break;
40                    case "fade":
41                        f.find("li").hide(), f.find("li").eq(o).fadeIn();
42                        break;
43                    case "slide-down":
44                        f.find("li.blog-ticker-list-active").animate({ top: 30, opacity: 0 }, 300, function() { x(this).removeClass("blog-ticker-list-active").hide() }), f.find("li").eq(o).css({ top: -30, opacity: 0 }).addClass("blog-ticker-list-active").show(), f.find("li").eq(o).animate({ top: 0, opacity: 1 }, 300);
45                        break;
46                    case "slide-up":
47                        f.find("li.blog-ticker-list-active").animate({ top: -30, opacity: 0 }, 300, function() { x(this).removeClass("blog-ticker-list-active").hide() }), f.find("li").eq(o).css({ top: 30, opacity: 0 }).addClass("blog-ticker-list-active").show(), f.find("li").eq(o).animate({ top: 0, opacity: 1 }, 300);
48                        break;
49                    case "slide-left":
50                        f.find("li.blog-ticker-list-active").animate({ left: "50%", opacity: 0 }, 300, function() { x(this).removeClass("blog-ticker-list-active").hide() }), f.find("li").eq(o).css({ left: -50, opacity: 0 }).addClass("blog-ticker-list-active").show(), f.find("li").eq(o).animate({ left: 0, opacity: 1 }, 300);
51                        break;
52                    case "slide-right":
53                        f.find("li.blog-ticker-list-active").animate({ left: "-50%", op
53acity: 0 }, 300, function() { x(this).removeClass("blog-ticker-list-active").hide() }), f.find("li").eq(o).css({ left: "50%", opacity: 0 }).addClass("blog-ticker-list-active").show(), f.find("li").eq(o).animate({ left: 0, opacity: 1 }, 300);
54                        break;
55                    default:
56                        f.find("li").hide(), f.find("li").eq(o).show()
57                }
58            },
59            q = function() {
60                if (m = !1, a.settings.play) switch (a.settings.effect) {
61                    case "scroll":
62                        ("rtl" === a.settings.direction ? b : y)();
63                        break;
64                    default:
65                        a.pause(), v = setInterval(function() { a.next() }, a.settings.delayTimer)
66                }
67            };
68        a.init = function() {
69            if (a.settings = x.extend({}, s, t), c.addClass("blog-ticker-effect-" + a.settings.effect + " blog-ticker-direction-" + a.settings.direction), l()) {
70
71            } else "html" === a.settings.source ? ("scroll" != a.settings.effect && C(), q()) : console.log('Please check your "source" parameter. Incorrect Value');
72            var r, o;
73            a.settings.play ? u.find("span").removeClass("blog-ticker-play").addClass("blog-ticker-pause") : u.find("span").removeClass("blog-ticker-pause").addClass("blog-ticker-play"), c.on("mouseleave", function(e) {
74                var t = x(document.elementFromPoint(e.clientX, e.clientY)).parents(".blog-ticker-breaking-news")[0];
75                x(this)[0] !== t && (!0 === a.settings.stopOnHover ? !0 === a.settings.play && a.play() : !0 === a.settings.play && !0 === m && a.play())
76            }), c.on("mouseenter", function() {!0 === a.settings.stopOnHover && a.pause() }), h.on("click", function() { w && (w = !1, a.pause(), a.next()) }), g.on("click", function() { w && (w = !1, a.pause(), a.prev()) }), u.on("click", function() { w && (u.find("span").hasClass("blog-ticker-pause") ? (u.find("span").removeClass("blog-ticker-pause").addClass("blog-ticker-play"), a.stop()) : (a.settings.play = !0, u.find("span").removeClass("blog-ticker-play").addClass("blog-ticker-pause"))) }), x(window).on("resize", function() { var e; "scroll" === a.settings.effect && (e = 0, p.each(function() { e += x(this).outerWidth() }), e += 10, f.css({ width: e })) })
77        }, a.pause = function() { m = !0, clearInterval(v) }, a.stop = function() { m = !0, a.settings.play = !1 }, a.play = function() { q() }, a.next = function() {
78            ! function() {
79                switch (a.settings.effect) {
80                    case "scroll":
81                        i();
82                        break;
83                    default:
84                        k <= ++o && (o = 0), C()
85                }
86            }()
87        }, a.prev = function() {
88            ! function() {
89                switch (a.settings.effect) {
90                    case "scroll":
91                        n();
92                        break;
93                    default:
94                        --o < 0 && (o = k - 1), C()
95                }
96            }()
97        }, a.init()
98    }, x.fn.breakingNews = function(t) {
99        return this.each(function() {
100            var e;
101            null == x(this).data("breakingNews") && (e = new x.breakingNews(this, t), x(this).data("breakingNews", e))
102        })
103    }
104}(jQuery);

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.