js实现图片切换,重点:图片不要用js获取list的长度存放,存放的图片太多用js获取list的长度不现实,求大神指教

符合网站标准的图片切换特效,图片自定义。
以下是程序代码&html&
&meta http-equiv=&Content-Type& content=&text/ charset=gb2312& /&
&meta name=&keywords& content=&站长,网页特效,js特效,js脚本,脚本,广告代码,zzjs,zzjs.net,sky,www.zzjs.net,站长特效 网& /&
&meta name=&description& content=&www.zzjs.net,站长特效网,站长必备js特效及广告代码。大量高质量js特效,提供高质量广告代码下载,尽在站长特效网& /&
&title&网页特效 图片切换特效-站长特效网欢迎您。&/title&
&style type=&text/css&&
/*新焦点滚动*/
#MPB {width: 282 height: 164}
#MPB #SlidePlayer { position: margin: 0}
#MPB .Slides {overflow: list-style-type: height: 164 margin: 0; padding: 0;}
#MPB .Slides LI {float:width: 282height: 164}
#MPB .Slides IMG {display:width: 282height: 164border:0}
#MPB .SlideTriggers {list-style-type:position:top:0height: 18 margin:4px 0px 0px 4padding: 0;width:16}
#MPB .SlideTriggers LI {display:background: url(/img/1_140742.gif) no-float:overflow:width: 16height: 16cursor:color:#0849AD;text-align:margin:1font: 13px A}
#MPB .SlideTriggers LI.Current {font:13px Acolor: #FFF;background: url(/img/1_140755.gif) no-width: 16height:16margin: 1}
&a href=&http://www.zzjs.net/&&站长特效网&/a&,站长必备的高质量网页特效和广告代码。zzjs.net,站长js特效。&hr&
&!--欢迎来到站长特效网,我们网站收集大量高质量js特效,提供许多广告代码下载,网址:www.zzjs.net,,用.net打造靓站--&
&script type=&text/javascript&&
if(typeof YAHOO==&undefined&){var YAHOO={};}
YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i&a.i=i+1){d=a[i].split(&.&);o=YAHOO;for(j=(d[0]==&YAHOO&)?1:0;j&d.j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}
};YAHOO.init=function(){this.namespace(&util&,&widget&,&example&);if(typeof YAHOO_config!=&undefined&){var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;if(l){for(i=0;i&ls.i=i+1){if(ls[i]==l){unique=}}//欢迎来到站长特效网,我们的网址是www.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。
if(unique){ls.push(l);}}}};YAHOO.register=function(name,mainClass,data){var mods=YAHOO.env.if(!mods[name]){mods[name]={versions:[],builds:[]};}
var m=mods[name],v=data.version,b=data.build,ls=YAHOO.env.m.name=m.version=v;m.build=b;m.versions.push(v);m.builds.push(b);m.mainClass=mainCfor(var i=0;i&ls.i=i+1){ls[i](m);}
if(mainClass){mainClass.VERSION=v;mainClass.BUILD=b;}else{YAHOO.log(&mainClass is undefined for module &+name,&warn&);}};YAHOO.env=YAHOO.env||{modules:[],listeners:[],getVersion:function(name){return YAHOO.env.modules[name]||}};YAHOO.lang={isArray:function(obj){},isBoolean:function(obj){return typeof obj=='boolean';},isFunction:function(obj){return typeof obj=='function';},isNull:function(obj){return obj===},isNumber:function(obj){return typeof obj=='number'&&isFinite(obj);},isObject:function(obj){return obj&&(typeof obj=='object'||YAHOO.lang.isFunction(obj));},isString:function(obj){return typeof obj=='string';},isUndefined:function(obj){return typeof obj=='undefined';},hasOwnProperty:function(obj,prop){},extend:function(subc,superc,overrides){if(!superc||!subc){throw new Error(&YAHOO.lang.extend failed, please check that &+&all dependencies are included.&);}
var F=function(){};F.prototype=superc.subc.prototype=new F();subc.prototype.constructor=subc.superclass=superc.if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=}
if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}}},augment:function(r,s){}};YAHOO.init();YAHOO.util.Lang=YAHOO.YAHOO.augment=YAHOO.lang.YAHOO.extend=YAHOO.lang.YAHOO.register(&yahoo&,YAHOO,{version:&2.2.2&,build:&204&});(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={};var ua=navigator.userAgent.toLowerCase(),isOpera=(ua.indexOf('opera')&-1),isSafari=(ua.indexOf('safari')&-1),isGecko=(!isOpera&&!isSafari&&ua.indexOf('gecko')&-1),isIE=(!isOpera&&ua.indexOf('msie')&-1);var patterns={HYPHEN:/(-[a-z])/i,ROOT_TAG:/body|html/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){}
if(propertyCache[property]){return propertyCache[property];}
var converted=while(patterns.HYPHEN.exec(converted)){converted=converted.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}
propertyCache[property]=};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=if(property=='float'){property='cssFloat';}
var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];}
return el.style[property]||};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){};}else{getStyle=function(el,property){return el.style[property];};}
if(isIE){setStyle=function(el,property,val){};}else{setStyle=function(el,property,val){if(property=='float'){property='cssFloat';}
el.style[property]=};}
YAHOO.util.Dom={get:function(el){if(YAHOO.lang.isString(el)){return document.getElementById(el);}
if(YAHOO.lang.isArray(el)){var c=[];for(var i=0,len=el.i&++i){c[c.length]=Y.Dom.get(el[i]);}
},getStyle:function(el,property){},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){},getX:function(el){},getY:function(el){},setXY:function(el,pos,noRetry){},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){var region=new Y.Region.getRegion(el);};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){},getElementsByClassName:function(className,tag,root){var method=function(el){return Y.Dom.hasClass(el,className);};return Y.Dom.getElementsBy(method,tag,root);},hasClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');var f=function(el){return re.test(el.className);};return Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,className){},removeClass:function(el,className){},replaceClass:function(el,oldClassName,newClassName){},generateId:function(el,prefix){},isAncestor:function(haystack,needle){},inDocument:function(el){},getElementsBy:function(method,tag,root){tag=tag||'*';var nodes=[];if(root){root=Y.Dom.get(root);if(!root){}}else{root=}
var elements=root.getElementsByTagName(tag);if(!elements.length&&(tag=='*'&&root.all)){elements=root.}
for(var i=0,len=elements.i&++i){if(method(elements[i])){nodes[nodes.length]=elements[i];}}
},batch:function(el,method,o,override){var id=el=Y.Dom.get(el);var scope=(override)?o:if(!el||el.tagName||!el.length){if(!el){}
return method.call(scope,el,o);}
var collection=[];for(var i=0,len=el.i&++i){if(!el[i]){id=el[i];}
collection[collection.length]=method.call(scope,el[i],o);}
},getDocumentHeight:function(){},getDocumentWidth:function(){},getViewportHeight:function(){},getViewportWidth:function(){}};})();
YAHOO.util.CustomEvent=function(type,oScope,silent,signature){
this.type=this.scope=oScope||this.silent=this.signature=signature||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(!fn){throw new Error(&Invalid callback for subscriber to '&+this.type+&'&);}
if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);}
this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){
},fire:function(){var len=this.subscribers.if(!len&&this.silent){}
var args=[],ret=true,i;for(i=0;i&arguments.++i){args.push(arguments[i]);}
var argslength=args.if(!this.silent){}
for(i=0;i&++i){var s=this.subscribers[i];if(s){if(!this.silent){}
var scope=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var param=if(args.length&0){param=args[0];}
ret=s.fn.call(scope,param,s.obj);}else{ret=s.fn.call(scope,this.type,args,s.obj);}
if(false===ret){if(!this.silent){}
},unsubscribeAll:function(){},_delete:function(index){},toString:function(){}};YAHOO.util.Subscriber=function(fn,obj,override){this.fn=this.obj=obj||this.override=};YAHOO.util.Subscriber.prototype.getScope=function(defaultScope){if(this.override){if(this.override===true){return this.}else{return this.}}
return defaultS};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=var DOMReady=var listeners=[];var unloadListeners=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=0;var lastError=
return{POLL_RETRYS:200,POLL_INTERVAL:10,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,isSafari:(/KHTML/gi).test(navigator.userAgent),webkit:function(){}(),isIE:(!this.webkit&&!navigator.userAgent.match(/opera/gi)&&navigator.userAgent.match(/msie/gi)),_interval:null,startInterval:function(){},onAvailable:function(p_id,p_fn,p_obj,p_override){},onDOMReady:function(p_fn,p_obj,p_override){},onContentReady:function(p_id,p_fn,p_obj,p_override){},addListener:function(el,sType,fn,obj,override){
if(this._isValidCollection(el)){}else
if(&unload&==sType&&obj!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,obj,override];}
var scope=if(override){if(override===true){scope=}else{scope=}}
var wrappedFn=function(e){return fn.call(scope,YAHOO.util.Event.getEvent(e),obj);};var li=[el,sType,fn,wrappedFn,scope];var index=listeners.listeners[index]=if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);if(legacyIndex==-1||el!=legacyEvents[legacyIndex][0]){legacyIndex=legacyEvents.legacyMap[el.id+sType]=legacyIlegacyEvents[legacyIndex]=[el,sType,el[&on&+sType]];legacyHandlers[legacyIndex]=[];el[&on&+sType]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),legacyIndex);};}
legacyHandlers[legacyIndex].push(li);}else{try{this._simpleAdd(el,sType,wrappedFn,false);}catch(ex){this.lastError=this.removeListener(el,sType,fn);}}},fireLegacyEvent:function(e,legacyIndex){},getLegacyIndex:function(el,sType){},useLegacyEvent:function(el,sType){},removeListener:function(el,sType,fn){},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcEreturn this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&3==node.nodeType){return node.parentN}else{}},getPageX:function(ev){},getPageY:function(ev){},getXY:function(ev){},getRelatedTarget:function(ev){},getTime:function(ev){},stopEvent:function(ev){},stopPropagation:function(ev){},preventDefault:function(ev){},getEvent:function(e){var ev=e||window.
},getCharCode:function(ev){},_getCacheIndex:function(el,sType,fn){
return-1;},generateId:function(el){},_isValidCollection:function(o){},elCache:{},getEl:function(id){},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent(&DOMReady&,this),_load:function(e){},_ready:function(e){},_tryPreloadAttach:function(){
this.locked=},purgeElement:function(el,recurse,sType){var elListeners=this.getListeners(el,sType);},getListeners:function(el,sType){var results=[],searchL
if(!sType){searchLists=[listeners,unloadListeners];}else
return(results.length)?results:},_unload:function(e){},_getScrollLeft:function(){},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent(&on&+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent(&on&+sType,fn);};}else{return function(){};}}()};}();(function(){var EU=YAHOO.util.EEU.on=EU.addL})();}
YAHOO.util.Connect={_msxml_progid:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:'application/x-www-form- charset=UTF-8',_use_default_xhr_header:true,_default_xhr_header:'XMLHttpRequest',_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function(){if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,'click',function(e){var obj=YAHOO.util.Event.getTarget(e);if(obj.type=='submit'){YAHOO.util.Connect._submitElementValue=encodeURIComponent(obj.name)+&=&+encodeURIComponent(obj.value);}})
})(),setProgId:function(id){this._msxml_progid.unshift(id);},setDefaultPostHeader:function(b){this._use_default_post_header=b;},setDefaultXhrHeader:function(b){this._use_default_xhr_header=b;},setPollingInterval:function(i){if(typeof i=='number'&&isFinite(i)){this._polling_interval=i;}},createXhrObject:function(transactionId){var obj,try{http=new XMLHttpRequest();obj={conn:http,tId:transactionId};}
catch(e){for(var i=0;i&this._msxml_progid.++i){try{http=new ActiveXObject(this._msxml_progid[i]);obj={conn:http,tId:transactionId};}
catch(e){}}}
var uploadCallback=function(){
setTimeout(function(){document.body.removeChild(io);},100);};if(YAHOO.util.Event){YAHOO.util.Event.addListener(io,&load&,uploadCallback);}
else if(window.attachEvent){io.attachEvent('onload',uploadCallback);}
else{io.addEventListener('load',uploadCallback,false);}},abort:function(o,callback,isTimeout){},isCallInProgress:function(o){},releaseObject:function(o){o.conn=o=}};
YAHOO.register(&connection&,YAHOO.util.Connect,{version:&2.2.2&,build:&204&});
YAHOO.util.Anim=function(el,attributes,duration,method){if(el){this.init(el,attributes,duration,method);}};
YAHOO.util.Anim.prototype={toString:function(){},patterns:{},doMethod:function(attr,start,end){},setAttribute:function(attr,val,unit){},getAttribute:function(attr){},getDefaultUnit:function(attr){},setRuntimeAttribute:function(attr){var attributes=this.this.runtimeAttributes[attr]={};var isset=function(prop){return(typeof prop!=='undefined');};
start=(isset(attributes[attr]['from']))?attributes[attr]['from']:this.getAttribute(attr);if(isset(attributes[attr]['to'])){end=attributes[attr]['to'];}else if(isset(attributes[attr]['by'])){if(start.constructor==Array){end=[];for(var i=0,len=start.i&++i){end[i]=start[i]+attributes[attr]['by'][i];}}else{end=start+attributes[attr]['by'];}}
this.runtimeAttributes[attr].start=this.runtimeAttributes[attr].end=this.runtimeAttributes[attr].unit=(isset(attributes[attr].unit))?attributes[attr]['unit']:this.getDefaultUnit(attr);},init:function(el,attributes,duration,method){var isAnimated=var startTime=var actualFrames=0;el=YAHOO.util.Dom.get(el);this.attributes=attributes||{};this.duration=duration||1;this.method=method||YAHOO.util.Easing.easeNthis.useSeconds=this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.this.getEl=function(){};this.isAnimated=function(){return isA};this.getStartTime=function(){return startT};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){}
this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(YAHOO.util.AnimMgr.fps*this.duration):this.YAHOO.util.AnimMgr.registerElement(this);};this.stop=function(finish){if(finish){this.currentFrame=this.totalFthis._onTween.fire();}
YAHOO.util.AnimMgr.stop(this);};var onStart=function(){this.onStart.fire();this.runtimeAttributes={};for(var attr in this.attributes){this.setRuntimeAttribute(attr);}
isAnimated=actualFrames=0;startTime=new Date();};var onTween=function(){var data={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};data.toString=function(){};this.onTween.fire(data);var runtimeAttributes=this.runtimeAfor(var attr in runtimeAttributes){this.setAttribute(attr,this.doMethod(attr,runtimeAttributes[attr].start,runtimeAttributes[attr].end),runtimeAttributes[attr].unit);}
actualFrames+=1;};var onComplete=function(){var actual_duration=(new Date()-startTime)/1000;var data={duration:actual_duration,frames:actualFrames,fps:actualFrames/actual_duration};data.toString=function(){return('duration: '+data.duration+', frames: '+data.frames+', fps: '+data.fps);};isAnimated=actualFrames=0;this.onComplete.fire(data);};this._onStart=new YAHOO.util.CustomEvent('_start',this,true);this.onStart=new YAHOO.util.CustomEvent('start',this);this.onTween=new YAHOO.util.CustomEvent('tween',this);this._onTween=new YAHOO.util.CustomEvent('_tween',this,true);this.onComplete=new YAHOO.util.CustomEvent('complete',this);this._onComplete=new YAHOO.util.CustomEvent('_complete',this,true);this._onStart.subscribe(onStart);this._onTween.subscribe(onTween);this._onComplete.subscribe(onComplete);}};YAHOO.util.AnimMgr=new function(){var thread=var queue=[];var tweenCount=0;this.fps=1000;this.delay=1;this.registerElement=function(tween){queue[queue.length]=tweenCount+=1;tween._onStart.fire();this.start();};this.unRegister=function(tween,index){tween._onComplete.fire();index=index||getIndex(tween);if(index!=-1){queue.splice(index,1);}
tweenCount-=1;if(tweenCount&=0){this.stop();}};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween){clearInterval(thread);for(var i=0,len=queue.i&++i){if(queue[0].isAnimated()){this.unRegister(queue[0],0);}}queue=[];thread=tweenCount=0;}
else{this.unRegister(tween);}};this.run=function(){for(var i=0,len=queue.i&++i){var tween=queue[i];if(!tween||!tween.isAnimated()){}
if(tween.currentFrame&tween.totalFrames||tween.totalFrames===null){tween.currentFrame+=1;if(tween.useSeconds){correctFrame(tween);}//欢迎来到站长特效网,我们的网址是www.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。
tween._onTween.fire();}
else{YAHOO.util.AnimMgr.stop(tween,i);}}};var getIndex=function(anim){
return-1;};var correctFrame=function(tween){var frames=tween.totalFvar frame=tween.currentFvar expected=(tween.currentFrame*tween.duration*1000/tween.totalFrames);var elapsed=(new Date()-tween.getStartTime());var tweak=0;if(elapsed&tween.duration*1000){tweak=Math.round((elapsed/expected-1)*tween.currentFrame);}else{tweak=frames-(frame+1);}
if(tweak&0&&isFinite(tweak)){
tween.currentFrame+=}};};(function(){YAHOO.util.ColorAnim=function(el,attributes,duration,method){YAHOO.util.ColorAnim.superclass.constructor.call(this,el,attributes,duration,method);};YAHOO.extend(YAHOO.util.ColorAnim,YAHOO.util.Anim);var Y=YAHOO.var superclass=Y.ColorAnim.var proto=Y.ColorAnim.proto.toString=function(){var el=this.getEl();var id=el.id||el.tagNreturn(&ColorAnim &+id);};proto.patterns.color=/color$/i;proto.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;proto.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;proto.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;proto.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;})();
YAHOO.util.Easing={easeNone:function(t,b,c,d){return c*t/d+b;}};(function(){YAHOO.util.Scroll=function(el,attributes,duration,method){if(el){YAHOO.util.Scroll.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Scroll,YAHOO.util.ColorAnim);var Y=YAHOO.var superclass=Y.Scroll.var proto=Y.Scroll.proto.toString=function(){var el=this.getEl();var id=el.id||el.tagNreturn(&Scroll &+id);};proto.doMethod=function(attr,start,end){var val=if(attr=='scroll'){val=[this.method(this.currentFrame,start[0],end[0]-start[0],this.totalFrames),this.method(this.currentFrame,start[1],end[1]-start[1],this.totalFrames)];}else{val=superclass.doMethod.call(this,attr,start,end);}
};proto.getAttribute=function(attr){var val=var el=this.getEl();if(attr=='scroll'){val=[el.scrollLeft,el.scrollTop];}else{val=superclass.getAttribute.call(this,attr);}
};proto.setAttribute=function(attr,val,unit){var el=this.getEl();if(attr=='scroll'){el.scrollLeft=val[0];el.scrollTop=val[1];}else{superclass.setAttribute.call(this,attr,val,unit);}};})();
TB.common={trim:function(str){return str.replace(/(^\s*)|(\s*$)/g,'');},escapeHTML:function(str){var div=document.createElement('div');var text=document.createTextNode(str);div.appendChild(text);return div.innerHTML;},unescapeHTML:function(str){var div=document.createElement('div');div.innerHTML=str.replace(/&\/?[^&]+&/gi,'');return div.childNodes[0]?div.childNodes[0].nodeValue:'';},toArray:function(list,start){var array=[];for(var i=start||0;i&list.i++){array[array.length]=list[i];}//欢迎来到站长特效网,我们的网址是www.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。
},applyConfig:function(obj,config){if(obj&&config&&typeof config=='object'){for(var p in config){if(!YAHOO.lang.hasOwnProperty(obj,p))
obj[p]=config[p];}}
TB.widget={};(function(){var Y=YAHOO.TB.widget.Slide=function(container,config){this.init(container,config);}
TB.widget.Slide.defConfig={slidesClass:'Slides',triggersClass:'SlideTriggers',currentClass:'Current',eventType:'click',autoPlayTimeout:5,disableAutoPlay:false};TB.widget.Slide.prototype={init:function(container,config){this.container=Y.Dom.get(container);this.mon.applyConfig(config||{},TB.widget.Slide.defConfig);try{this.slidesUL=Y.Dom.getElementsByClassName(this.config.slidesClass,'ul',this.container)[0];this.slides=this.slidesUL.getElementsByTagName('li');}catch(e){throw new Error(&can't find slides!&);}
this.delayTimeId=this.autoPlayTimeId=this.curSlide=-1;this.sliding=this.pause=this.onSlide=new Y.CustomEvent(&onSlide&,this,false,Y.CustomEvent.FLAT);if(YAHOO.lang.isFunction(this.config.onSlide)){this.onSlide.subscribe(this.config.onSlide,this,true);}
this.initSlides();this.initTriggers();if(this.slides.length&0)
this.play(1);if(!this.config.disableAutoPlay){this.autoPlay();}},initTriggers:function(){var ul=document.createElement('ul');this.container.appendChild(ul);for(var i=0;i&this.slides.i++){var li=document.createElement('li');li.innerHTML=i+1;ul.appendChild(li);}
ul.className=this.config.triggersCthis.triggersUL=if(this.config.eventType=='mouse'){Y.Event.on(this.triggersUL,'mouseover',this.mouseHandler,this,true);Y.Event.on(this.triggersUL,'mouseout',function(e){clearTimeout(this.delayTimeId);},this,true);}else{Y.Event.on(this.triggersUL,'click',this.clickHandler,this,true);}},initSlides:function(){Y.Event.on(this.slides,'mouseover',function(){this.pause=},this,true);Y.Event.on(this.slides,'mouseout',function(){this.pause=},this,true);Y.Dom.setStyle(this.slides,'display','none');},clickHandler:function(e){var t=Y.Event.getTarget(e);var idx=parseInt(t.innerHTML);while(t!=this.container){if(t.nodeName.toUpperCase()==&LI&){if(!this.sliding){this.play(idx,true);}
}else{t=t.parentN}}},mouseHandler:function(e){var t=Y.Event.getTarget(e);var idx=parseInt(t.innerHTML);while(t!=this.container){if(t.nodeName.toUpperCase()==&LI&){var self=this.delayTimeId=setTimeout(function(){self.play(idx,true);},(self.sliding?.5:.1)*1000);}else{t=t.parentN}}},play:function(n,flag){n=n-1;if(n==this.curSlide)var curSlide=this.curSlide&=0?this.curSlide:0;if(flag&&this.autoPlayTimeId)
clearInterval(this.autoPlayTimeId);var triggersLis=this.triggersUL.getElementsByTagName('li');triggersLis[curSlide].className='';triggersLis[n].className=this.config.currentCthis.slide(n);this.curSlide=n;if(flag&&!this.config.disableAutoPlay)
this.autoPlay();},slide:function(n){var curSlide=this.curSlide&=0?this.curSlide:0;this.sliding=Y.Dom.setStyle(this.slides[curSlide],'display','none');Y.Dom.setStyle(this.slides[n],'display','block');this.sliding=this.onSlide.fire(n);},autoPlay:function(){var self=var callback=function(){if(!self.pause&&!self.sliding){var n=(self.curSlide+1)%self.slides.length+1;self.play(n,false);}}
this.autoPlayTimeId=setInterval(callback,this.config.autoPlayTimeout*1000);}}
TB.widget.ScrollSlide=function(container,config){this.init(container,config);}
YAHOO.extend(TB.widget.ScrollSlide,TB.widget.Slide,{initSlides:function(){TB.widget.ScrollSlide.superclass.initSlides.call(this);Y.Dom.setStyle(this.slides,'display','');},slide:function(n){var curSlide=this.curSlide&=0?this.curSlide:0;var args={scroll:{by:[0,this.slidesUL.offsetHeight*(n-curSlide)]}};var anim=new Y.Scroll(this.slidesUL,args,.5,Y.Easing.easeOutStrong);anim.onComplete.subscribe(function(){this.sliding=this.onSlide.fire(n);},this,true);anim.animate();this.sliding=}});TB.widget.FadeSlide=function(container,config){this.init(container,config);}
YAHOO.extend(TB.widget.FadeSlide,TB.widget.Slide,{initSlides:function(){TB.widget.FadeSlide.superclass.initSlides.call(this);Y.Dom.setStyle(this.slides,'position','absolute');Y.Dom.setStyle(this.slides,'top',this.config.slideOffsetY||0);Y.Dom.setStyle(this.slides,'left',this.config.slideOffsetX||0);Y.Dom.setStyle(this.slides,'z-index',1);},slide:function(n){if(this.curSlide==-1){Y.Dom.setStyle(this.slides[n],'display','block');}else{var curSlideLi=this.slides[this.curSlide];Y.Dom.setStyle(curSlideLi,'display','block');Y.Dom.setStyle(curSlideLi,'z-index',10);var fade=new Y.Anim(curSlideLi,{opacity:{to:0}},.5,Y.Easing.easeNone);fade.onComplete.subscribe(function(){Y.Dom.setStyle(curSlideLi,'z-index',1);Y.Dom.setStyle(curSlideLi,'display','none');Y.Dom.setStyle(curSlideLi,'opacity',1);this.sliding=this.onSlide.fire(n);},this,true);Y.Dom.setStyle(this.slides[n],'display','block');fade.animate();this.sliding=}}});})();TB.widget.SimpleSlide=new function(){this.decorate=function(container,config){if(!container)config=config||{};if(config.effect=='scroll'){if(navigator.product&&navigator.product=='Gecko'){if(YAHOO.util.Dom.get(container).getElementsByTagName('iframe').length&0){new TB.widget.Slide(container,config);}}
new TB.widget.ScrollSlide(container,config);}
else if(config.effect=='fade'){new TB.widget.FadeSlide(container,config);}
else{new TB.widget.Slide(container,config);}}}
&div id=&MPB&&&div id=&SlidePlayer&&
&ul class=&Slides&&
&li&&A title=&天极网软件频道2007年热点专题回放& href=&http://www.zzjs.net/&&&img src=&/img/1_01321ta_zzjs.jpg& alt=&站长特效2007年热点专题回放&&&/A&&/li&&li&&A title=&完全解析Windows XP SP3的最新特性& href=&http://www.zzjs.net/&&&img src=&/img/1__zzjs.jpg& alt=&完全解析Windows XP SP3的最新特性&&&/A&&/li&&li&&A title=&视频转换宝典在手 视频格式想转就转不求人& href=&http://www.zzjs.net/&&&img src=&/img/1__zzjs.jpg& alt=&视频转换宝典在手 视频格式想转就转不求人&&&/A&&/li&&li&&A title=&3DsMAX专区全新上线& href=&http://www.zzjs.net/&&&img src=&/img/1_22204C61_zzjs.jpg& alt=&3DsMAX专区全新上线&&&/A&&/li&&li&&A title=&谁适合你?各大安全工具最新版功能比拼& href=&http://www.zzjs.net/&&&img src=&/img/1_0T012Y8.jpg& alt=&谁适合你?各大安全工具最新版功能比拼&&&/A&&/li&
&li&&a title=&2007中国IT网络调查 火热进行中& href=&http://www.zzjs.net/&&&img src=&/img/.jpg& alt=&2007中国IT网络调查 火热进行中& border=&0&&&/a&&/li&
&/div&&/div&
&script type=&text/javascript&&
TB.widget.SimpleSlide.decorate('SlidePlayer', {eventType:'mouse', effect:'scroll'});
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
( 10:55:38)
( 14:12:49)
相关排行总榜

我要回帖

更多关于 js list 的文章

 

随机推荐