1// é»è®¤obj为æ§è¡å ç´ 2 3// HOVER 4 // é»è®¤æ ·å¼ .h , é»è®¤Hoveræ ·å¼ .hover 5 // èªå®ä¹HOVERå¯ä½¿ç¨ Hover(obj, classname) 6$(function(){ 7 $(".h").hover(function(){ 8 $(this).addClass("hover") 9 }, function(){ 10 $(this).removeClass("hover") 11 }) 12}) 13function Hover(obj, classname) { 14 obj.hover(function(){ 15 $(this).addClass(classname) 16 }, function(){ 17 $(this).removeClass(classname) 18 }) 19} 20 21// TAB 22 // é»è®¤ç¦ç¹æ ·å¼ .cur 23 // ä¸ºé²æ¢xpç³»ç»opacityå¯è½åºç°çé¯é½¿æè¾¹ç¼æ¨¡ç³ï¼ é»è®¤.tabboxææ.show() / .hide() 24 // æå±.tabboxæopacityï¼ éå¨.tabboxä¸å ä¸ data-effect="true" 25function Tab(tabBtn, tabBox) { 26 var tabbl = true; 27 tabBtn.eq(0).addClass("cur") 28 tabBox.eq(0).show() 29 tabBtn.click(function(){ 30 var n = $(this).index(); 31 $(this).addClass("cur").siblings().removeClass("cur") 32 if(tabBox.attr("data-effect") == "true"){ 33 if(!tabbl){ 34 return 35 } 36 tabbl = false; 37 tabBox.eq(n).stop().fadeIn(800).siblings().stop().fadeOut(800, function(){ 38 tabbl = true; 39 }) 40 }else{ 41 tabBox.eq(n).show().siblings().hide() 42 } 43 }) 44} 45 46// å¾çå ¨å± / å¾çå æ»¡æ´ä¸ªç¶çº§ 47 // é»è®¤boxèªå¸¦loadingèæ¯å¾ 48 // é»è®¤obj hide 49function FullBg(box, obj){ 50 box.css("background", "none") 51 obj.eq(0).stop().fadeIn(1000) 52 function resizeBg() { 53 obj.removeClass("w-f").removeClass("h-f").css("margin", 0) 54 var boxR = box.outerWidth() / box.outerHeight(), 55 objR = obj.width() / obj.height(); 56 if( objR < boxR ) { 57 obj.addClass('w-f').css("margin-top", -(obj.height() - box.outerHeight()) / 2); 58 }else{ 59 obj.addClass('h-f').css("margin-left", -(obj.width() - box.outerWidth()) / 2); 60 } 61 } 62 $(window).resize(resizeBg).trigger("resize"); 63} 64// è§é¢å ¨å± / è§é¢å 满æ´ä¸ªç¶çº§ (videoè·å宽髿é®é¢) 65function videoFull(obj, width, height){ 66 var $video = obj 67 function resizeBg() { 68 $video.attr("width", "").attr("height", "").attr("style", "") 69 var boxR = $('.top-video').outerWidth() / $('.top-video').outerHeight(), 70 objR = width / height; 71 72 if( objR < boxR ) { 73 $video.attr("width", "100%") 74 var videoHeight = $video.width() / objR 75 var top = - (videoHeight - $('.top-video').outerHeight()) / 2 > 0 ? 0 : - (videoHeight - $('.top-video').outerHeight()) / 2 76 $video.css("margin-top", top); 77 }else{ 78 $video.attr("height", "100%") 79 var videoWidth = $video.height() * objR 80 var left = - (videoWidth - $('.top-video').outerWidth()) / 2 > 0 ? 0 : - (videoWidth - $('.top-video').outerWidth()) / 2 81 $video.css("margin-left", left); 82 } 83 } 84 $(window).resize(resizeBg).trigger("resize"); 85} 86 87 88// æ ç¾è¿åºææ 89 // ç¨äºå¤å¹³çº§æ ç¾ä¾æ¬¡è½½å ¥ é»è®¤æ ç¾å ·æposition屿§åopacuty: 0; 90 // direction ä»åªä¸ªæ¹åè¿å ¥ 91 // distance è¿å ¥å°æå®è·ç¦» 92 // number 平级æ ç¾çä¸ªæ° 93 // time è¿åºå¨ç»çæ¶é´ 94 // delay ä¸ä¸æ ç¾çå»¶è¿ 95 // callback åè°å½æ° 96function Enter(obj, direction, distance, number, time, delay, callback) { 97 // ä»å·¦å¾å³ï¼distance > 0 98 if(direction == "left"){ 99 obj.stop().animate({ 100 left : distance, 101 opacity : 1 102 }, time) 103 setTimeout(function(){ 104 if(obj.next().index() != -1){ 105 Enter(obj.next(), direction, distance, number, time, delay, callback) 106 }else{ 107 setTimeout(function(){ 108 callback = callback || function(){}; 109 callback (); 110 return 111 }, time - delay) 112 } 113 }, delay) 114 } 115 // ä»ä¸å¾ä¸ï¼distance > 0 116 if(direction == "top"){ 117 obj.stop().animate({ 118 top : distance, 119 opacity : 1 120 }, time) 121 setTimeout(function(){ 122 if(obj.next().index() != -1){ 123 Enter(obj.next(), direction, distance, number, time, delay, callback) 124 }else{ 125 setTimeout(function(){ 126 callback = callback || function(){}; 127 callback (); 128 return 129 }, time - delay) 130 } 131 }, delay) 132 } 133 // CSS3 Xä½ç§» 134 if(direction == "X"){ 135 obj.stop().transition({ 136 x : distance, 137 opacity : 1 138 }, time) 139 setTimeout(function(){ 140 if(obj.next().index() != -1){ 141 Enter(obj.next(), direction, distance, number, time, delay, callback) 142 }else{ 143 setTimeout(function(){ 144 callback = callback || function(){}; 145 callback (); 146 return 147 }, time - delay) 148 } 149 }, delay) 150 } 151 // CSS3 yä½ç§» 152 if(direction == "Y"){ 153 obj.stop().transition({ 154 y : distance, 155 opacity : 1 156 }, time) 157 setTimeout(function(){ 158 if(obj.next().index() != -1){ 159 Enter(obj.next(), direction, distance, number, time, delay, callback) 160 }else{ 161 setTimeout(function(){ 162 callback = callback || function(){}; 163 callback (); 164 return 165 }, time - delay) 166 } 167 }, delay) 168 } 169} 170 171// å¾çå è½½ è°ç¨æ¹æ³ 172// _PreLoadImg([ 173 // å¾çè·¯å¾(æ°ç»å½¢å¼) 174// ],function(){ 175 176// }) 177function _PreLoadImg(b,e){var c=0,a={},d=0;for(src in b){d++}for(src in b){a[src]=new Image();a[src].onload=function(){if(++c>=d){e(a)}};a[src].src=b[src]}}; 178
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.