1/* 2* Tadas Juozapaitis ( [email protected] ) 3*/ 4 5(function($){ 6$.fn.vTicker = function(options) { 7 var defaults = { 8 speed: 700, 9 pause: 4000, 10 showItems: 2, 11 animation: '', 12 mousePause: true 13 }; 14 15 var options = $.extend(defaults, options); 16 17 moveUp = function(obj, height){ 18 obj = obj.children('ul'); 19 first = obj.children('li:first').clone(true); 20 21 obj.animate({top: '-=' + height + 'px'}, options.speed, function() { 22 $(this).children('li:first').remove(); 23 $(this).css('top', '0px'); 24 }); 25 26 if(options.animation == 'fade') 27 { 28 obj.children('li:first').fadeOut(options.speed); 29 obj.children('li:last').hide().fadeIn(options.speed); 30 } 31 32 first.appendTo(obj); 33 }; 34 35 return this.each(function() { 36 obj = $(this); 37 maxHeight = 0; 38 39 obj.css({overflow: 'hidden', position: 'relative'}) 40 .children('ul').css({position: 'absolute', margin: 0, padding: 0}) 41 .children('li').css({margin: 0, padding: 0}); 42 43 obj.children('ul').children('li').each(function(){ 44 if($(this).height() > maxHeight) 45 { 46 maxHeight = $(this).height(); 47 } 48 }); 49 50 obj.children('ul').children('li').each(function(){ 51 $(this).height(maxHeight); 52 }); 53 54 obj.height(maxHeight * options.showItems); 55 56 interval = setInterval('moveUp(obj, maxHeight)', options.pause); 57 58 if(options.mousePause) 59 { 60 obj.bind("mouseenter",function(){ 61 clearInterval(interval); 62 }).bind("mouseleave",function(){ 63 interval = setInterval('moveUp(obj, maxHeight)', options.pause); 64 }); 65 } 66 }); 67}; 68})(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.