1// JavaScript Document 2;(function($){ 3 $.fn.extend({ 4 myslide:function(options){ 5 var setting=$.extend({ 6 speed:3000, 7 titleBg:'#000' 8 },options); 9 return $(this).each(function() { 10 var t=this; 11 var imgWidth=$('#myslide').width();//$('img',t).width(); 12 var imgCount=$('img',t).size(); 13 var currentIndex=imgCount-1; 14 var timerId; 15 16 $(this).wrapInner('<div class="myslide-frame" style="z-index:100; position:absolute; left:0; width:'+(imgWidth*imgCount)+100+'px;"></div>'); 17 18 var html='<ul class="myslide-button">'; 19 for(var i=1;i<=imgCount;i++){ 20 html+='<li>'+i+'</li>'; 21 } 22 html+='</ul><div class="myslide-titleBg" style="z-index:103; background:'+setting.titleBg+'; position:absolute; bottom:0; width:330px; height:30px;filter:alpha(opacity=50);-moz-opacity:0.5;opacity: 0.5;"></div><div class="myslide-title" style="z-index:104; position:absolute; bottom:0; width:325px; height:30px; overflow:hidden; line-height:30px;"><a style=" color:#fff; padding-left:10px;" href="#"></a></div>'; 23 24 $(html).appendTo(t); 25 26 $('li',this).click(function(){ 27 stopPlay(); 28 currentIndex=$(this).index(); 29 $('.myslide-frame',t).stop().animate({ 30 'left':-imgWidth*currentIndex 31 },'slow'); 32 33 $(this).addClass('current').siblings().removeClass('current'); 34 35 var a=$('.myslide-frame a',t).eq(currentIndex); 36 $('.myslide-title a',t).attr('href',a.attr('href')).html(a.attr('title')); 37 timerId=window.setTimeout(autoPlay,setting.speed); 38 }); 39 40 $(this).hover(function(){ 41 stopPlay(); 42 },function(){ 43 timerId=window.setTimeout(autoPlay,setting.speed); 44 }) 45 function stopPlay(){ 46 window.clearTimeout(timerId); 47 } 48 function autoPlay(){ 49 $('li:eq('+(currentIndex+1)%imgCount+')',t).click(); 50 } 51 autoPlay(); 52 }); 53 } 54 }); 55})(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.