(function (a) { a.fn.vTicker = function (b) { var c = { speed: 700, pause: 4e3, showItems: 3, animation: "", mousePause: true, isPaused: false, direction: "up", height: 0 }; var b = a.extend(c, b); moveUp = function (b, c, d) { if (d.isPaused) return; var e = b.children("ul"); var f = e.children("li:first").clone(true); if (d.height > 0) { c = e.children("li:first").height() } e.animate({ top: "-=" + c + "px" }, d.speed, function () { a(this).children("li:first").remove(); a(this).css("top", "0px") }); if (d.animation == "fade") { e.children("li:first").fadeOut(d.speed); if (d.height == 0) { e.children("li:eq(" + d.showItems + ")").hide().fadeIn(d.speed).show() } } f.appendTo(e) }; moveDown = function (b, c, d) { if (d.isPaused) return; var e = b.children("ul"); var f = e.children("li:last").clone(true); if (d.height > 0) { c = e.children("li:first").height() } e.css("top", "-" + c + "px").prepend(f); e.animate({ top: 0 }, d.speed, function () { a(this).children("li:last").remove() }); if (d.animation == "fade") { if (d.height == 0) { e.children("li:eq(" + d.showItems + ")").fadeOut(d.speed) } e.children("li:first").hide().fadeIn(d.speed).show() } }; return this.each(function () { var c = a(this); var d = 0; c.css({ overflow: "hidden", position: "relative" }).children("ul").css({ position: "absolute", margin: 0, padding: 0 }).children("li").css({ margin: 0, padding: 0 }); if (b.height == 0) { c.children("ul").children("li").each(function () { if (a(this).height() > d) { d = a(this).height() } }); c.children("ul").children("li").each(function () { a(this).height(d) }); c.height(d * b.showItems) } else { c.height(b.height) } var e = setInterval(function () { if (b.direction == "up") { moveUp(c, d, b) } else { moveDown(c, d, b) } }, b.pause); if (b.mousePause) { c.bind("mouseenter", function () { b.isPaused = true }).bind("mouseleave", function () { b.isPaused = false }) } }) } })(jQuery)
