1/*! 2 * liScroll 1.0 3 * Examples and documentation at: 4 * http://www.gcmingati.net/wordpress/wp-content/lab/jquery/newsticker/jq-liscroll/scrollanimate.html 5 * 2007-2010 Gian Carlo Mingati 6 * Version: 1.0.2.1 (22-APRIL-2011) 7 * Dual licensed under the MIT and GPL licenses: 8 * http://www.opensource.org/licenses/mit-license.php 9 * http://www.gnu.org/licenses/gpl.html 10 * Requires: 11 * jQuery v1.2.x or later 12 * 13 */ 14var AtScrollSpeed = "0.15"; 15var AtScrollText = "Latest News"; 16var $ = jQuery.noConflict(); 17 18jQuery.fn.liScroll = function(settings) { 19 settings = jQuery.extend({ 20 travelocity: 0.07 21 }, settings); 22 return this.each(function(){ 23 var $strip = jQuery(this); 24 $strip.addClass("newsticker") 25 var chkWidth = 50; 26 if (chkWidth < 40) { 27 chkWidth = 50+50; 28 } 29 var stripWidth = 1; 30 $strip.find("li").each(function(i){ 31 stripWidth += jQuery(this, i).outerWidth(true)+50+chkWidth; // thanks to Michael Haszprunar and Fabien Volpi 32 }); 33 var $mask = $strip.wrap("<div class='mask'></div>"); 34 var $tickercontainer = $strip.parent().wrap("<div class='tickercontainer'></div>"); 35 var containerWidth = $strip.parent().parent().width(); //a.k.a. 'mask' width 36 $strip.width(stripWidth); 37 var totalTravel = stripWidth+containerWidth; 38 var defTiming = totalTravel/settings.travelocity; // thanks to Scott Waye 39 function scrollnews(spazio, tempo){ 40 $strip.animate({left: '-='+ spazio}, tempo, "linear", function(){$strip.css("left", containerWidth); scrollnews(totalTravel, defTiming);}); 41 } 42 scrollnews(totalTravel, defTiming); 43 $strip.hover(function(){ 44 jQuery(this).stop(); 45 }, 46 function(){ 47 var offset = jQuery(this).offset(); 48 var residualSpace = offset.left + stripWidth; 49 var residualTime = residualSpace/settings.travelocity; 50 scrollnews(residualSpace, residualTime); 51 }); 52 }); 53}; 54 55 56 $(function(){ 57 $("ul#at_ticker").liScroll({travelocity: AtScrollSpeed}); 58 }); 59 60 61 // Change Text if it exists 62 63 if (document.getElementById('at_scroll_text') !=null ){ 64 document.getElementById("at_scroll_text").innerHTML = AtScrollText; 65 }
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.