1// $Id: views.ticker.fade.js,v 1.1 2008/04/14 13:11:32 vvn Exp $ 2(function ($) { 3 $.fn.newsTicker = $.fn.newsticker = function (b) { 4 b = b || 4000; 5 initTicker = function (a) { 6 stopTicker(a); 7 a.items = $("li", a); 8 a.items.not(":eq(0)").hide().end(); 9 a.currentitem = 0; 10 startTicker(a) 11 }; 12 startTicker = function (a) { 13 a.tickfn = setInterval(function () { 14 doTick(a) 15 }, b) 16 }; 17 stopTicker = function (a) { 18 clearInterval(a.tickfn) 19 }; 20 pauseTicker = function (a) { 21 a.pause = true 22 }; 23 resumeTicker = function (a) { 24 a.pause = false 25 }; 26 doTick = function (a) { 27 if (a.pause) return; 28 a.pause = true; 29 $(a.items[a.currentitem]).fadeOut("slow", function () { 30 $(this).hide(); 31 a.currentitem = ++a.currentitem % (a.items.size()); 32 $(a.items[a.currentitem]).fadeIn("slow", function () { 33 a.pause = false 34 }) 35 }) 36 }; 37 this.each(function () { 38 if (this.nodeName.toLowerCase() != "ul") return; 39 initTicker(this) 40 }).addClass("newsticker").hover(function () { 41 pauseTicker(this) 42 }, function () { 43 resumeTicker(this) 44 }); 45 return this 46 } 47})(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.