PageSourceSearch

http://www.jinhu.gov.cn/dist/myfocus-2.0.4.full.js

js jinhu.gov.cn collected 2026-10-02 16:41:56 UTC 22,369 bytes, 585 lines download raw bytes

1/*!
2 * myFocus JavaScript Library v2.0.4
3 * https://github.com/koen301/myfocus
4 * 
5 * Copyright 2012, Koen Lee
6 * Released under the MIT license
7 * 
8 * Date: 2012/10/28
9 */
10(function(){
11	//DOM基础操作函数
12	var $id=function(id){
13			return typeof id==='string'?document.getElementById(id):id;
14		},
15		$tag=function(tag,parentNode){
16			return ($id(parentNode)||document).getElementsByTagName(tag);
17		},
18		$tag_=function(tag,parentNode){
19			return $getChild(tag,parentNode,'tag');
20		},
21		$class=function(className,parentNode){
22			var doms=$tag('*',parentNode),arr=[];
23			for(var i=0,l=doms.length;i<l;i++){
24				if(hasClass(className,doms[i])){
25					arr.push(doms[i]);
26				}
27			}
28			return arr;
29		},
30		$class_=function(className,parentNode){
31			return $getChild(className,parentNode);
32		},
33		$getChild=function(selector,parentNode,type){
34			var arr=[],fn=type==='tag'?$tag:$class,doms=fn(selector,parentNode),len=doms.length;
35			for(var i=0;i<len;i++){
36				if(doms[i].parentNode===parentNode) arr.push(doms[i]);
37				i+=fn(selector,doms[i]).length;
38			}
39			return arr;
40		},
41		hasClass=function(className,node){
42			return eval('/(^|\\s)'+className+'(\\s|$)/').test(node.className);
43		};
44	//定义myFocus全局变量
45	myFocus=function(settings){
46		return new myFocus.constr(settings);
47	};
48	//扩展
49	myFocus.extend=function(){
50		var arg=arguments,len=arg.length;
51		if(this===myFocus){//作为方法扩展,如果只有一个参数扩展本身
52			if(len===1) dest=myFocus,i=0;//扩展myFocus类
53			else dest=arg[0],i=1;
54		}else{//扩展引用对象本身
55			dest=this,i=0;
56		}
57		for(i;i<len;i++){
58			for(var p in arg[i]){
59				dest[p]=arg[i][p];//dest属性最低
60			}
61		}
62		return dest;
63	};
64	myFocus.extend({
65		defConfig:{//全局默认设置
66			pattern:'mF_fancy',//风格样式
67			trigger:'click',//触发切换模式['click'(鼠标点击)|'mouseover'(鼠标悬停)]
68			txtHeight:'default',//文字层高度设置[num(数字,单位像素,0表示隐藏文字层,省略设置即为默认高度)]
69			wrap:true,//是否需要让程序添加焦点图的外围html(wrap)元素(目的是为了添加某些风格的边框)[true|false]
70			auto:true,//是否自动播放(切换)[true|false]
71			time:4,//每次停留时间[num(数字,单位秒)]
72			index:0,//开始显示的图片序号(从0算起)[num(数字)]
73			loadingShow:true,//是否显示Loading画面[true(显示,即等待图片加载完)|false(不显示,即不等待图片加载完)]
74			delay:100,//触发切换模式中'mouseover'模式下的切换延迟[num(数字,单位毫秒)]
75			autoZoom:false,//是否允许图片自动缩放居中[true|false]
76			onChange:null,//切换图片的时候执行的自定义函数,带有一个当前图索引的参数
77			xmlFile:'',//myfocus图片的xml配置文件路径,留空即不读取xml文件
78			__focusConstr__:true//程序构造参数
79		},
80		constr:function(settings){//构造函数
81			var e=settings,len=e&&e.length;
82			if(e instanceof myFocus.constr) return e;//myFocus::[]
83			this.length=0;
84			if(!e||(e.sort&&!len)||(e.item&&!len)){//null/array::[]/nodeList::[]
85				Array.prototype.push.call(this);
86			}else if(e.__focusConstr__){//new myFocus
87				e=$id(e.id);
88				Array.prototype.push.call(this,e);
89				this.settings=settings;
90				this.HTMLUList=$tag('li',$tag('ul',e)[0]);
91				this.HTMLUListLength=this.HTMLUList.length;
92			}else if(len){//nodeList/Array/字符串
93				for(var i=0;i<len;i++) Array.prototype.push.call(this,e[i]);
94			}else{//node
95				Array.prototype.push.call(this,e);
96			}
97			return this;
98		},
99		fn:{splice:[].splice},//原形
100		pattern:{},//风格集
101		config:{}
101//参数集
102	});
103	myFocus.constr.prototype=myFocus.fn;
104	myFocus.fn.extend=myFocus.pattern.extend=myFocus.config.extend=myFocus.extend;
105	myFocus.fn.extend({//DOM
106		find:function(selector){//选择器只应用基本查找,暂不考虑用querySelectorAll
107			var parent=this,isChild=false,$=myFocus;
108			var arr=this.parseSelector(selector);
109			if(this.length) for(var i=0,len=arr.length;i<len;i++){
110				var dom=[],s=arr[i];
111				switch(s.charAt(0)){
112					case '>'://children
113						isChild=true;
114						break;
115					case '.'://class
116						var cls=s.slice(1);
117						var fn=isChild?$class_:$class;
118						$(parent).each(function(){
119							dom=dom.concat(fn(cls,this));
120						});
121						isChild=false;
122						break;
123					case '#'://id
124						var id=s.slice(1),e=$id(id);
125						if(e) dom.push($id(id));
126						isChild=false;
127						break;
128					default://tag(支持'tag.class'寻找,不支持也不建议用'tag#id'寻找,请用'#id')
129						var fn=isChild?$tag_:$tag,sArr=s.split('.');
130						var tag=sArr[0],cls=sArr[1];
131						$(parent).each(function(){
132							var arr=fn(tag,this);
133							for(var i=0,len=arr.length;i<len;i++){
134								if(cls&&!hasClass(cls,arr[i])) continue;
135								dom.push(arr[i]);
136							}
137						});
138						isChild=false;
139				}
140				if(!isChild) parent=dom;//循环赋值父元素
141			}
142			return $(parent);
143		},
144		parent:function(){
145			return myFocus(this[0].parentNode);
146		},
147		html:function(s){
148			if(typeof s!=='undefined'){this[0].innerHTML=s;return this;}
149			else return this[0].innerHTML;
150		},
151		each:function(fn){
152			var doms=this;
153			for(var i=0,len=doms.length;i<len;i++){
154				var flag=fn.call(doms[i],i);
155				if(flag===false) break;
156				if(flag===true) continue;
157			}
158			return this;
159		},
160		eq:function(n){
161			return myFocus(this[n]);
162		},
163		parseSelector:function(selector){
164			var chunker=/(([^[\]'"]+)+\]|\\.|([^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g;
165			var parts=[],m;
166			while((m = chunker.exec(selector)) !== null ) {
167				parts.push( m[1] );//存储匹配的字符串信息
168			}
169			return parts;
170		},
171		wrap:function(html){//每次只wrap一个元素,多个请用each
172			var o=this[0],e=document.createElement('div');
173			e.innerHTML=html;
174			var wrap=e.firstChild;
175			o.parentNode.replaceChild(wrap,o);
176			wrap.appendChild(o);
177			return this;
178		},
179		addHtml:function(html){
180			var parent=this[0];
181			var e=document.createElement('div');
182			e.innerHTML=html;
183			var dom=e.childNodes[0];
184			parent.appendChild(dom);
185			return myFocus(dom);
186		},
187		addList:function(className,type){
188			var li=this.HTMLUList,n=this.HTMLUListLength;
189			var strArr=['<div class="'+className+'"><ul>'];
190			for(var i=0;i<n;i++){
191				var img=$tag('img',li[i])[0],html;
192				switch(type){
193					case 'num'  :html='<a>'+(i+1)+'</a><b></b>';break;//b标签主要是为了做透明背景,下同
194					case 'txt'  :html=img?li[i].innerHTML.replace(/\<img(.|\n|\r)*?\>/i,img.alt)+'<p>'+img.getAttribute("text")+'</p><b></b>':'';break;
195					case 'thumb':html=img?'<a><img src='+(img.getAttribute("thumb")||img.src)+' /></a><b></b>':'';break;
196					default     :html='<a></a><b></b>';
197				}
198				strArr.push('<li>'+html+'</li>');
199			}
200			strArr.push('</ul></div>');
201			return this.addHtml(strArr.join(''));
202		},
203		addListNum:function(className){
204			return this.addList(className||'num','num');//默认class=num
205		},
206		addListTxt:function(className){
207			return this.addList(className||'txt','txt');//默认class=txt
208		},
209		addListThumb:function(className){
210			return this.addList(className||'thumb','thumb');//默认class=thumb
211		},
212		remove:function(){
213			var o=this[0];
214			if(o) o.parentNode.removeChild(o);
215		},
216		repeat:function(n){
217			var n=n||2,pNode=this[0].parentNode,html=pNode.innerHTML,s=[];
218			for(var i=0;i<n;i++) s.push(html);
219			pNode.innerHTML=s.join('');
220			return myFocus(pNode).find(this[0].nodeName);
221		}
222	});
223	myFocus.fn.extend({//CSS
224		css:function(css){//可获值或设值
225			var o=this[0],value,arr=[';'],isIE=myFocus.isIE;
226			if(!o) return this;
227			if(typeof css==='string'){//获得css属性值,返回值不带单位
228				if(css==='float') css=isIE?'styleFloat':'cssFloat';
229				if(!(value=o.style[css])) value=(isIE?o.currentStyle:getComputedStyle(o,''))[css];
230				if(css==='opacity'&&value===undefined) value=1;//仅为在IE中得到默认值1
231				if(value==='auto'&&(css==='width'||css==='height')) value=o['offset'+css.replace(/\w/i,function(a){return a.toUpperCase()})];
232				var numVal=parseFloat(value);
233				return isNaN(numVal)?value:numVal;
234			}else{//设置css属性值,不支持('height','300px')形式,请变成-->({height:'300px'}),可以不带单位px
235				for(var p in css){
236					if(typeof css[p]==='number'&&!this.cssNumber[p]) css[p]+='px';
237					arr.push(p.replace(/([A-Z])/g,'-$1')+':'+css[p]+';');
238					if(p==='opacity') arr.push('filter:alpha(opacity='+css[p]*100+')');
239				}
240				o.style.cssText+=arr.join('');
241				return this;
242			}
243		},
244		setOpacity:function(value){//仅用于animate要求高效的核心算法中,其它情况可用css()代替
245			this[0].style.opacity=value,this[0].style.filter='alpha(opacity='+value*100+')';
246		},
247		setAnimateStyle:function(value,prop,m){//仅用于animate要求高效的核心算法中,其它情况可用css()代替
248			this[0].style[prop]=Math[m](value)+'px';
249		},
250		addClass:function(className){
251			this[0].className+=' '+className;
252			return this;
253		},
254		removeClass:function(className){
255			var o=this[0],cls=className&&o.className,reg="/\\s*\\b"+className+"\\b/g";
256			o.className=cls?cls.replace(eval(reg),''):'';
257			return this;
258		},
259		cssNumber:{fillOpacity:true,fontWeight:true,lineHeight:true,opacity:true,orphans:true,widows:true,zIndex:true,zoom:true}//不加px的css,参考jQuery
260	});
261	myFocus.fn.extend({//Animate
262		animate:function(attr,value,time,type,funcBefore,funcAfter){//value支持相对增值'+=100',相对减值'-=100'形式
263			var $o=this,o=$o[0],isOpacity=attr==='opacity',diffValue=false;
264			funcBefore&&funcBefore.call(o);
265			if(typeof value==='string'){
266				if(/^[+-]=\d+/.test(value)) value=value.replace('=',''),diffValue=true;
267				value=parseFloat(value);
268			}
269			var	oriVal=$o.css(attr),//原始属性值
270				b=isNaN(oriVal)?0:oriVal,//开始值,无值时为0
271				c=diffValue?value:value-b,//差值
272				d=time,//总运行时间
273				e=this.easing[type],//缓动类型
274				m=c>0?'ceil':'floor',//取最大绝对值
275				timerId='__myFocusTimer__'+attr,//计数器id
276				setProperty=$o[isOpacity?'setOpacity':'setAnimateStyle'],//属性设置方法
277				origTime=(new Date)*1;//原始时间值
278			o[timerId]&&clearInterval(o[timerId]);
279			o[timerId]=setInterval(function(){
280				var t=(new Date)-origTime;//已运行时间
281				if(t<=d){
282					setProperty.call($o,e(t,b,c,d),attr,m);
283				}else{
284					setProperty.call($o,b+c,attr,m);//设置最终值
285					clearInterval(o[timerId]),o[timerId]=null;
286					funcAfter&&funcAfter.call(o);
287				}
288			},13);
289			return this;
290		},
291		fadeIn:function(time,type,fn){
292			if(typeof time!=='number') fn=time,time=400;//默认400毫秒
293			if(typeof type==='function') fn=type,type='';
294			this.animate('opacity',1,time,type||'linear',function(){
295				myFocus(this).css({display:'block',opacity:0}
295);
296			},fn);
297			return this;
298		},
299		fadeOut:function(time,type,fn){
300			if(typeof time!=='number') fn=time,time=400;//默认400毫秒
301			if(typeof type==='function') fn=type,type='';
302			this.animate('opacity',0,time,type||'linear',null,function(){
303				this.style.display='none';
304				fn&&fn.call(this);
305			});
306			return this;
307		},
308		slide:function(params,time,type,fn){
309			if(typeof time!=='number') fn=time,time=800;//默认800毫秒
310			if(typeof type==='function') fn=type,type='';
311			for(var p in params) this.animate(p,params[p],time,type||'easeOut',null,fn);
312			return this;
313		},
314		stop:function(){//停止所有运动
315			var o=this[0];
316			for(var p in o) if(p.indexOf('__myFocusTimer__')!==-1) o[p]&&clearInterval(o[p]);
317			return this;
318		},
319		easing:{
320			linear:function(t,b,c,d){return c*t/d + b;},
321			swing:function(t,b,c,d) {return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;},
322			easeIn:function(t,b,c,d){return c*(t/=d)*t*t*t + b;},
323			easeOut:function(t,b,c,d){return -c*((t=t/d-1)*t*t*t - 1) + b;},
324			easeInOut:function(t,b,c,d){return ((t/=d/2) < 1)?(c/2*t*t*t*t + b):(-c/2*((t-=2)*t*t*t - 2) + b);}
325		}
326	});
327	myFocus.fn.extend({//Method(fn)
328		bind:function(type,fn){
329			myFocus.addEvent(this[0],type,fn);
330			return this;
331		},
332		play:function(funcLastFrame,funcCurrentFrame,seamless){
333			var	this_=this,p=this_.settings,n=this_.HTMLUListLength,t=p.time*1000,seamless=seamless||false,//是否无缝
334				float=myFocus(this_.HTMLUList).css('float'),isLevel=float==='left',//仅支持'left'方向和'top'方向
335				direction=isLevel?'left':'top',distance=isLevel?p.width:p.height,//运动距离
336				indexLast=0,indexCurrent=p.index;//帧索引值,默认0
337			this_.find('.loading').remove();//删除loading...
338			this_.run=function(value){//循环运动函数,支持+-=value
339				funcLastFrame&&funcLastFrame(indexLast,n);//运行前一帧
340				indexCurrent=typeof value==='string'?indexLast+parseInt(value.replace('=','')):value;//fixed index
341				if(indexCurrent<=-1){//prev run
342					indexCurrent=n-1;//转到最后一帧
343					if(seamless) this_.HTMLUList[0].parentNode.style[direction]=-n*distance+'px';//无缝的UL定位
344				}
345				if(indexCurrent>=n){//next run
346					if(!seamless) indexCurrent=0;//非无缝时转到第一帧
347					if(indexCurrent>=2*n){//无缝
348						this_.HTMLUList[0].parentNode.style[direction]=-(n-1)*distance+'px';//无缝的UL定位
349						indexCurrent=n;
350					}
351				}
352				if(seamless&&indexLast>=n&&indexCurrent<n) indexCurrent+=n;//无缝时的按钮点击(保持同一方向)
353				funcCurrentFrame&&funcCurrentFrame(indexCurrent,n,indexLast);//运行当前帧
354				this_.runIndex=indexLast=indexCurrent;//保存已运行的帧索引
355				//增加自定义回调函数@10.27
356				p.onChange&&p.onChange.call(this_,indexCurrent);
357			};
358			//运行...(try是为了兼容风格js中play比bindControl先执行)
359			try{this_.run(indexCurrent)}catch(e){setTimeout(function(){this_.run(indexCurrent)},0)};
360			if(p.auto&&n>1){//自动切换
361				this_.runTimer=setInterval(function(){this_.run('+=1')},t);//默认递增运行每帧
362				this_.bind('mouseover',function(){//绑定事件
363					clearInterval(this_.runTimer);
364					this_.runTimer='pause';//标记以防止执行两次this_.runTimer
365				}).bind('mouseout',function(){
366					if(!this_.isStop&&this_.runTimer==='pause') this_.runTimer=setInterval(function(){this_.run('+=1')},t);
367				});
368			}
369			this_.find('a').each(function(){//去除IE链接虚线
370				this.onfocus=function(){this.blur();}
371			});
372		},
373		bindControl:function($btnList,params){//params={thumbShowNum(略缩图显示数目(如果有)):num,isRunning(运行中的标记(当需要判断时)):boolean}
374			var this_=this,p=this_.settings,type=p.trigger,delay=p.delay,par=params||{},tsNum=par.thumbShowNum||p.thumbShowNum;
375			var run=function(){
376				if(this.index!==this_.runIndex&&!par.isRunning){
377					this_.run(this.index);
378					return false;//阻止冒泡&默认事件
379				}
380			};
381			$btnList.each(function(i){
382				this.index=i;//记录自身索引
383				var o=this,$o=myFocus(o);
384				if(type==='click'){
385					$o.bind('mouseover',function(){
386						$o.addClass('hover');
387					}).bind('mouseout',function(){
388						$o.removeClass('hover');
389					}).bind('click',run);
390				}else if(type==='mouseover'){
391					$o.bind('mouseover',function(){
392						if(delay===0) run.call(o);
393						else $btnList.mouseoverTimer=setTimeout(function(){run.call(o)},delay);
394					}).bind('mouseout',function(){
395						$btnList.mouseoverTimer&&clearTimeout($btnList.mouseoverTimer);
396					});
397				}else{
398					alert('myFocus Error Setting(trigger) : \"'+type+'\"');
399					return false;
400				};
401			});
402			if(tsNum){//thumb
403				var float=$btnList.css('float'),isLevel=float==='left'||float==='right';
404				$btnList.dir=isLevel?'left':'top';//方向
405				$btnList.n=this_.HTMLUListLength;//总数
406				$btnList.showNum=tsNum;//显示数目
407				$btnList.showStart=p.index;//显示的开始索引
408				$btnList.showEnd=$btnList.showStart+tsNum-1;//显示的结尾索引
409				$btnList.distance=$btnList.css(isLevel?'width':'height');//运动距离
410				$btnList.slideBody=$btnList.parent();//运动对象(ul)
411			}
412		},
413		scrollTo:function(i,time){
414			var n=this.n,dir=this.dir,$ul=this.slideBody,css={};//总数/方向/滑动body(ul)/样式
415			if(i>=this.showEnd){//next
416				this.showEnd=i<n-1?i+1:i;
417
418				this.showStart=this.showEnd-this.showNum+1;
419			}else if(i<=this.showStart){//prev
420				this.showStart=i>0?i-1:0;
421				this.showEnd=this.showStart+this.showNum-1;
422			}
423			css[dir]=-this.showStart*this.distance;
424			$ul.slide(css,time||500,'easeOut');
425			return this;
426		}
427	});
428	myFocus.extend({//Init
429		set:function(p,callback){
430			var F=this,id=p.id,oStyle=F.initBaseCSS(id);
431			p.pattern=p.pattern||F.defConfig.pattern;
432			p.__clsName=p.pattern+'_'+id;
433			F.addEvent(window,'load',function(){F.onloadWindow=true});
434			F.loadPattern(p,function(){
435				p=F.extend({},F.defConfig,F.config[p.pattern],p);//收集完整参数
436				F.getBoxReady(p,function(){
437					var $o=F($id(id));
438					p.$o=$o;//保存node
439					//xml load
440					p.xmlFile&&F.loadXML(p);
441					p.pic=$class('pic',$o[0])[0];//保存node for是否标准风格的判断及是否需要initcss
442					p.width=p.width||$o.css('width'),p.height=p.height||$o.css('height');//获得box高/宽
443					F.initCSS(p,oStyle);//css
444					$o.addClass(p.pattern+' '+p.__clsName);//+className
445					F.getIMGReady(p,function(arrSize){
446						if(p.autoZoom) F.zoomIMG(p,arrSize);//缩放图片
447						F.pattern[p.pattern](p,F);//运行pattern代码
448						callback&&callback();
449					});
450				});
451			});
452		},
453		onloadWindow:false,
454		loadPattern:function(p,callback){
455			if(this.pattern[p.pattern]){callback();return;}//如果已加载pattern
456			var path=this.getFilePath()+'mf-pattern/'+p.pattern;
457			var js= document.createElement("script"),css=document.createElement("link"),src=path+'.js',href=path+'.css'; 
458			js.type = "text/javascript",js.src=src;
459			css.rel = "stylesheet",css.href=href;
460			var head=$tag('head')[0],isSuccess=false,timeout=10*1000;//超时10秒
461			head.appendChild(css);
462			head.appendChild(js);
463			js.onload=js.onreadystatechange=function(){
464				if(isSuccess) return;//防止IE9+重复执行
465				if(!js.readyState||js.readyState=="loaded"||js.readyState=="complete"){
466					isSuccess=true;
467					callback();
468					js.onload=js.onreadystatechange=null;
469				}
470			};
471			setTimeout(function(){if(!isSuccess) $id(p.id).innerHTML='加载失败: '+src;},timeout);
472		},
473		getFilePath:function(){
474			var path='';
475			var scripts=$tag("script");
476			for(var i=0,len=scripts.length;i<len;i++){
477				var src=scripts[i].src;
478				if(src&&/myfocus([\.-].*)?\.js/i.test(src)){//兼容myfocus.js/myfocus.min.js/myfocus-2.x.js
479					path=src;
480					break;
481				}
482			};
483			return path.slice(0,path.lastIndexOf('/')+1);
484		},
485		getBoxReady:function(p,fn){
486			var F=this;
487			(function(){
488				try{
489					if(F.isIE) $id(p.id).doScroll();
490					else $id(p.id).innerHTML;
491					fn();
492				}catch(e){
493					if(!F.onloadWindow) setTimeout(arguments.callee,0);
494				}
495			})();
496		},
497		getIMGReady:function(p,callback){
498			var isShow=p.loadingShow;
499			var box=$id(p.id),img=$tag('img',p.pic),len=img.length,
500				count=0,done=false,arrSize=new Array(len);
501			if(!isShow||!len){callback();return;}//无延迟
502			for(var i=0;i<len;i++){
503				var IMG=new Image();
504				IMG.i=i;//标记前后顺序
505				IMG.onload=function(){
506					count+=1;
507					arrSize[this.i]={w:this.width,h:this.height};//储存for zoomIMG
508					if(count==len&&!done){done=true,callback(arrSize);}
509				};
510				IMG.src=img[i].src;
511			};
512		},
513		zoomIMG:function(p,arrSize){
514			var imgs=$tag('img',p.pic),len=imgs.length,boxWidth=p.width,boxHeight=p.height;
515			for(var i=0;i<len;i++){
516				var w=arrSize[i].w,h=arrSize[i].h;
517				if(w == boxWidth && h == boxHeight) continue;
518				if(w < boxWidth && h < boxHeight){
519					var width=w,height=h,top=(boxHeight-height)/2;
520				}else if(w / h >= boxWidth / boxHeight){
521					var width=boxWidth,height=boxWidth/w*h,top=(boxHeight-height)/2;
522				}else{
523					var width=boxHeight/h*w,height=boxHeight,top=0;
524				}
525				imgs[i].style.cssText=';width:'+width+'px;height:'+height+'px;margin-top:'+top+'px;';
526			};
527		},
528		initCSS:function(p,oStyle){
529			var css=[],w=p.width||'',h=p.height||'';
530			if(p.pic){
531				css.push('.'+p.__clsName+' *{margin:0;padding:0;border:0;list-style:none;}.'+p.__clsName+'{position:relative;width:'+w+'px;height:'+h+'px;overflow:hidden;font:12px/1.5 Verdana;text-align:left;background:#fff;visibility:visible!important;}.'+p.__clsName+' .pic{position:relative;width:'+w+'px;height:'+h+'px;overflow:hidden;}.'+p.__clsName+' .txt li{width:'+w+'px;height:'+p.txtHeight+'px!important;overflow:hidden;}');
532				if(p.wrap) p.$o.wrap('<div class="'+p.pattern+'_wrap"></div>');
533				if(p.autoZoom) css.push('.'+p.__clsName+' .pic li{text-align:center;width:'+w+'px;height:'+h+'px;}');//缩放图片居中
534			}
535			try{oStyle.styleSheet.cssText=css.join('')}catch(e){oStyle.innerHTML=css.join('')}
536		},
537		initBaseCSS:function(id){
538			var s='#'+id+' *{display:none}',oStyle=document.createElement('style');
539			oStyle.type='text/css';
540			try{oStyle.styleSheet.cssText=s}catch(e){oStyle.innerHTML=s}
541			var oHead = $tag('head',document)[0];
542			oHead.insertBefore(oStyle,oHead.firstChild);
543			return oStyle;
544		}
545	});
546	myFocus.extend({//Method(myFocus)
547		isIE:!!(document.all&&navigator.userAgent.indexOf('Opera')===-1),//!(+[1,]) BUG IN IE9+
548		addEvent:function(o,type,fn){
549			var ie=this.isIE,e=ie?'attachEvent':'addEventListener',t=(ie?'on':'')+type;
550			o[e](t,function(e){
551				var e=e||window.event,flag=fn.call(o,e);
552				if(flag===false){
553					if(ie) e.cancelBubble=true,e.returnValue=false;
554					else e.stopPropagation(),e.preventDefault();
555				}
556			},false);
557		},
558		loadXML:function(p){
559			var xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLDOM");
560			xmlhttp.open("GET", p.xmlFile + "?" + Math.random(), false);
561			xmlhttp.send(null);
562			this.appendXML(xmlhttp.responseXML,p);
563		},
564		appendXML:function(xml,p){
565			var items=xml.documentElement.getElementsByTagName("item"),len=items.length;
566			var html=['<div class="loading"></div><div class="pic"><ul>'];
567			for(var i=0;i<len;i++){
568				html.push('<li><a href="'+items[i].getAttribute('href')+'"><img src="'+items[i].getAttribute('image')+'" thumb="'+items[i].getAttribute('thumb')+'" alt="'+items[i].getAttribute('title')+'" text="'+items[i].getAttribute('text')+'" /></a></li>');
569			}
570			html.push('</ul></div>');
571			p.$o[0].innerHTML=html.join('');
572		}
573	});
574	//支持JQ
575	if(typeof jQuery!=='undefined'){
576		jQuery.fn.extend({
577			myFocus:function(p,fn){
578				if(!p) p={};
579				p.id=this[0].id;
580				if(!p.id) p.id=this[0].id='mF__ID__';
581				myFocus.set(p,fn);
582			}
583		});
584	}
585})();

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.