1 $(function(){ 2 var $block = $('#abgne_fade_pic'), 3 $ad = $block.find('.ad'), 4 showIndex = 0, // é è¨è¦å 顯示é£ä¸å¼µ 5 fadeOutSpeed = 1000, // æ·¡åºçé度 6 fadeInSpeed = 1000, // æ·¡å ¥çé度 7 defaultZ = 10, // é è¨ç z-index 8 isHover = false, 9 timer, speed = 2000; // è¨æå¨å輪æåæçé度 10 11 // å æå ¶å®åççè®æéæ 12 $ad.css({ 13 opacity: 0, 14 zIndex: defaultZ - 1 15 }).eq(showIndex).css({ 16 opacity: 1, 17 zIndex: defaultZ 18 }); 19 20 // çµåºå³ä¸çæé 21 var str = ''; 22 for(var i=0;i<$ad.length;i++){ 23 str += '<a href="#">' + (i + 1) + '</a>'; 24 } 25 var $controlA = $('#abgne_fade_pic').append($('<div class="control">' + str + '</div>').css('zIndex', defaultZ + 1)).find('.control a'); 26 27 // ç¶æé被é»é¸æ 28 // è¥è¦è®ææ»é¼ æ»å ¥ä¾åææ, å¯ä»¥æ click ææ mouseover 29 $controlA.click(function(){ 30 // åå¾ç®å黿çè碼 31 showIndex = $(this).text() * 1 - 1; 32 33 // 顯示ç¸å°æçåå並æå ¶å®ååè®æéæ 34 $ad.eq(showIndex).stop().fadeTo(fadeInSpeed, 1, function(){ 35 if(!isHover){ 36 // ååè¨æå¨ 37 timer = setTimeout(autoClick, speed + fadeInSpeed); 38 } 39 }).css('zIndex', defaultZ).siblings('a').stop().fadeTo(fadeOutSpeed, 0).css('zIndex', defaultZ - 1); 40 // è® a å ä¸ .on 41 $(this).addClass('on').siblings().removeClass('on'); 42 43 return false; 44 }).focus(function(){ 45 $(this).blur(); 46 }).eq(showIndex).addClass('on'); 47 48 $block.hover(function(){ 49 isHover = true; 50 // åæ¢è¨æå¨ 51 clearTimeout(timer); 52 }, function(){ 53 isHover = false; 54 // ååè¨æå¨ 55 timer = setTimeout(autoClick, speed); 56 }) 57 58 // èªå黿ä¸ä¸å 59 function autoClick(){ 60 if(isHover) return; 61 showIndex = (showIndex + 1) % $controlA.length; 62 $controlA.eq(showIndex).click(); 63 } 64 65 // ååè¨æå¨ 66 timer = setTimeout(autoClick, speed); 67 });
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.