1function getVersion() 2{ 3 var browser=navigator.appName; 4 var b_version=navigator.appVersion; 5 var version=b_version.split(";"); 6 var trim_Version=version[1].replace(/[ ]/g,""); 7 return (browser=="Microsoft Internet Explorer" && trim_Version=="MSIE10.0"); 8} 9 10function ImageChangeNews(uid, width, height, interval, duration, btitle, bsummary, zoomtype, zoomout, isCenterCutImg, cutImgParent) 11{ 12 var _this = this; //æthisä¿å䏿¥ï¼ä»¥åç¨_this代æ¿thisï¼è¿æ ·å°±ä¸ä¼è¢«thiså¼æäº 13 14 _this.imgs = new Array(); //å¾çç» 15 _this.urls = new Array(); //龿¥ç» 16 _this.titles = new Array(); //æ é¢ç» 17 _this.summarys = new Array(); //æè¦ç» 18 _this.tipTitles = new Array(); //é¼ æ æç¤º 19 20 _this.nextIndex=0; //䏿¬¡æ¾ç¤ºçæ»å¨å¾ 21 _this.currentIndex=-1; //å½åæ¾ç¤ºçæ»å¨å¾ 22 _this.firstFlag = 0; //æ è¯æ¯å¦ä¸ºç¬¬ä¸æ¬¡å¼å§æ§è¡ 23 _this.currentTimer = null; //æ è¯ä½ç¨ 24 25 //å¾çå è½½å®æ¯äºä»¶ 26 _this.onimgload = function(loadIndex) 27 { 28 _this.imgs[loadIndex].setAttribute("loadedflag", true); 29 if(loadIndex == _this.currentIndex) 30 { 31 _this.constrainimg(document.getElementById(uid + "pic"), _this.imgs[loadIndex], document.getElementById(uid + "imgdiv")); 32 } 33 } 34 35 //æ·»å å¾ç 36 _this.addimg = function(img, url, title, summary,tipTitle) 37 { 38 var imgcount = _this.imgs.length; 39 _this.imgs[imgcount] = new Image(); 40 41 _this.imgs[imgcount].onload = function(){_this.onimgload(imgcount)}; 42 43 _this.imgs[imgcount].src = img; 44 45 _this.urls[imgcount] = url; 46 _this.titles[imgcount] = title; 47 _this.summarys[imgcount] = summary; 48 if(tipTitle){ 49 _this.tipTitles[imgcount] = tipTitle; 50 } 51 } 52 53 //触åå¾çæ¹å 54 _this.changeimg = function (n) 55 { 56 if(_this.imgs.length < 1) 57 { 58 return; 59 } 60 61 if(_this.currentTimer != null) 62 window.clearInterval(_this.currentTimer); //æ¸ é¤ç¨äºå¾ªç¯çcurrentTimer 63 64 _this.currentTimer = window.setInterval(_this.onchangeimg, interval * 1000);//设置循ç¯å¨æä¸º4000 65 66 _this.nextIndex = n; //è¦æ¾ç¤ºçIDçäºä¼ å ¥çNå¼, 67 _this.onchangeimg(); 68 } 69 70 //æ¹åå¾çæä½ 71 _this.onchangeimg = function() 72 { 73 try 74 { 75 if(_this.imgs.length < 1) 76 { 77 return; 78 } 79 if(_this.firstFlag == 0) 80 { 81 _this.firstFlag = 1; 82 } 83 else if(document.all && !getVersion()) 84 { 85 var imgfilter = document.getElementById(uid + "div").filters[0]; 86 imgfilter.Apply(); 87 imgfilter.Play(duration); 88 imgfilter.transition=23; 89 } 90 //å¾çæªå è½½å®æ¯ 91 if(_this.imgs[_this.nextIndex].getAttribute("loadedflag") == null) 92 { 93 document.getElementById(uid + "pic").src = "/system/resource/images/space.gif"; 94 } 95 else 96 { 97 //å¾çæ£å¸¸å è½½, 设置å¾ç 98 _this.constrainimg(document.getElementById(uid + "pic"), _this.imgs[_this.nextIndex], document.getElementById(uid + "imgdiv")); 99 } 100 //设置å½åå¾çç¼å· 101 _this.currentIndex = _this.nextIndex; 102 103 104 document.getElementById(uid + "url").href = _this.urls[_this.nextIndex]; 105 106 btitle = true; 107 if(btitle) 108 { 109 document.getElementById(uid + "newstitle").innerHTML = _this.titles[_this.nextIndex]; 110 111 document.getElementById(uid + "newstitle").href = _this.urls[_this.nextIndex]; 112 if(_this.tipTitles.length > 0){ 113 document.getElementById(uid + "newstitle").title =_this.tipTitles[_this.nextIndex]; 114 }else{ 115 document.getElementById(uid + "newstitle").title =_this.titles[_this.nextIndex]; 116 } 117 118 } 119 if(bsummary) 120 { 121 document.getElementById(uid + "newssummary").innerHTML = _this.summarys[_this.nextIndex]; 122 document.getElementById(uid + "newssummary").href = _this.urls[_this.nextIndex]; 123 } 124 //è®¾ç½®æææé®çæ ·å¼ 125 for(var i = 0;i < _this.imgs.length; i++) 126 { 127 if(i == _this.nextIndex) 128 document.getElementById(uid + "selectNode"+i).className='imagechangenews_fno
128de'; 129 else 130 document.getElementById(uid + "selectNode"+i).className='imagechangenews_pnode'; 131 } 132 _this.nextIndex++; 133 if(_this.nextIndex >= _this.imgs.length) 134 { 135 //妿IDå¤§äºæ»å¾çæ°éãåä»å¤´å¼å§å¾ªç¯ 136 _this.nextIndex = 0; 137 } 138 } 139 catch(e) 140 { 141 } 142 } 143 144 //çæ¯ä¾è®¾ç½®å¾ç 145 _this.constrainimg = function(imgobj, imagevar, imgdiv) 146 { 147 try 148 { 149 var widthrate = imagevar.width / width; 150 var heightrate = imagevar.height / height; 151 var imgwidth = 0; 152 var imgheight = 0; 153 154 if(widthrate > 1 || heightrate > 1) //å¾çè¿å¤§æ¶ 155 { 156 if(!isCenterCutImg) { 157 if (zoomtype)//ææ¯ä¾ç¼©å° 158 { 159 var rate = Math.max(widthrate, heightrate); 160 imgwidth = Math.max(1, Math.min(imagevar.width / rate, width)); 161 imgheight = Math.max(1, Math.min(imagevar.height / rate, height)); 162 } 163 else//æä¼¸ 164 { 165 imgwidth = width; 166 imgheight = height; 167 } 168 } 169 } 170 else if(widthrate < 1 || heightrate < 1) //å¾çå° 171 { 172 if(!isCenterCutImg) { 173 if (zoomout)//èªå¨æ¾å¤§ 174 { 175 if (zoomtype)//ææ¯ä¾æ¾å¤§ 176 { 177 var rate = Math.max(widthrate, heightrate); 178 imgwidth = Math.max(1, Math.min(imagevar.width / rate, width)); 179 imgheight = Math.max(1, Math.min(imagevar.height / rate, height)); 180 } 181 else //æä¼¸ 182 { 183 imgwidth = width; 184 imgheight = height; 185 } 186 187 } 188 else { 189 imgwidth = imagevar.width; 190 imgheight = imagevar.height; 191 } 192 } 193 } 194 else //大å°åé 195 { 196 imgwidth = width; 197 imgheight = height; 198 } 199 200 imgobj.src = imagevar.src; 201 if(!isCenterCutImg) { 202 imgobj.width = imgwidth; 203 imgobj.height = imgheight; 204 imgdiv.style.paddingTop = (height - imgheight) / 2+"px"; 205 }else{ 206 cutImg(imgobj,"autocut",cutImgParent); 207 } 208 } 209 catch(e) 210 { 211 } 212 } 213}
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.