1$(function(){ 2 var n = $(".banner li").length 3 $(".banner li").each(function(){ 4 var _this = $(this), 5 src = _this.attr("data-img"), 6 img = new Image(); 7 img.src = src; 8 //å¤çffä¸ä¼èªå¨è¯»åç¼åå¾ç 9 if(img.complete || img.width){ 10 _this.attr("style","background:url("+src+") no-repeat center"); 11 n -- ; 12 if(n == 0){ 13 banner(); 14 } 15 return; 16 } 17 $(img).load(function(){ 18 _this.attr("style","background:url("+src+") no-repeat center"); 19 n -- ; 20 if(n == 0){ 21 banner(); 22 } 23 }); 24 }) 25}) 26function banner(){ 27 //åå§åbanneræ ·å¼ 28 var listN = $(".banner li").length; 29 $(".loader").stop().fadeOut(1000); 30 $(".banner li").eq(0).fadeIn(1000); 31 for (var i = 0; i < listN; i++) { 32 $(".banner .btns").prepend('<span class="span'+i+' fl"></span>'); 33 }; 34 $(".banner .btns").css("margin-left",-$(".btns").width()/2); 35 $(".banner .btns span").eq(0).addClass("cur"); 36 37 38 // æ§è¡ææ 39 var sw = 1; 40 $(".banner .btns span").mouseover(function(){ 41 sw = $(this).index(); 42 myShow(sw); 43 }); 44 function myShow(i){ 45 $(".banner .btns span").eq(i).addClass("cur").siblings("span").removeClass("cur"); 46 $(".banner li").eq(i).stop(true,true).fadeIn(1000).siblings().stop(true,true).fadeOut(1000); 47 } 48 $('.banner .btns .prev').on('click',function(){ 49 sw=$(".banner .btns span.cur").index(); 50 sw==0?sw=(listN-1):sw--; 51 console.log(sw); 52 myShow(sw); 53 }) 54 $('.banner .btns .next').on('click',function(){ 55 sw=$(".banner .btns span.cur").index(); 56 sw==(listN-1)?sw=0:sw++; 57 myShow(sw); 58 }) 59 // æ»å ¥åæ¢å¨ç»ï¼æ»åºå¼å§å¨ç» 60 $(".banner").hover(function(){ 61 if(myTime){ 62 clearInterval(myTime); 63 } 64 },function(){ 65 clearInterval(myTime); 66 myTime = setInterval(function(){ 67 myShow(sw); 68 sw++; 69 if(sw == listN){sw = 0;} 70 }, 5000); 71 }); 72 // èªå¨å¼å§, åå»ºå®æ¶å¨ 73 var myTime = setInterval(function(){ 74 myShow(sw); 75 sw++; 76 if(sw == listN){sw = 0;} 77 }, 5000); 78}
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.