1/*********************************************** 2* Ultimate Fade-In Slideshow (v1.5): ? Dynamic Drive (http://www.dynamicdrive.com) 3* This notice MUST stay intact for legal use 4* Visit http://www.dynamicdrive.com/ for this script and 100s more. 5***********************************************/ 6 7//var fadeimages=new Array() 8//SET IMAGE PATHS. Extend or contract array as needed 9//fadeimages[0]=["photo1.jpg", "", ""] //plain image syntax 10//fadeimages[1]=["photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax 11//fadeimages[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax 12 13var fadeimages2=new Array() //2nd array set example. Remove or add more sets as needed. 14//SET IMAGE PATHS. Extend or contract array as needed 15//fadeimages2[0]=["photo1.jpg", "", ""] //plain image syntax 16//fadeimages2[1]=["photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax 17//fadeimages2[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax 18 19var fadebgcolor="white" 20 21////NO need to edit beyond here///////////// 22 23var fadearray=new Array() //array to cache fadeshow instances 24var fadeclear=new Array() //array to cache corresponding clearinterval pointers 25 26var dom=(document.getElementById) //modern dom browsers 27var iebrowser=document.all 28 29function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder, contentBox){ 30this.pausecheck=pause 31this.mouseovercheck=0 32this.delay=delay 33this.degree=10 //initial opacity degree (10%) 34this.curimageindex=0 35this.nextimageindex=1 36fadearray[fadearray.length]=this 37this.slideshowid=fadearray.length-1 38this.canvasbase="canvas"+this.slideshowid 39this.curcanvas=this.canvasbase+"_0" 40if (typeof displayorder!="undefined") 41theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :) 42this.theimages=theimages 43this.imageborder=parseInt(borderwidth) 44this.postimages=new Array() //preload images 45for (p=0;p<theimages.length;p++){ 46this.postimages[p]=new Image() 47this.postimages[p].src=theimages[p][0] 48} 49 50var fadewidth=fadewidth+this.imageborder*2 51var fadeheight=fadeheight+this.imageborder*2 52var contentdiv=document.getElementById(contentBox); 53 54if (contentdiv) 55{ 56if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox) 57contentdiv.innerHTML='<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;opacity:10;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;opacity:10;background-color:'+fadebgcolor+'"></div></div>'; 58else 59contentdiv.innerHTML='<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>'; 60 61if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox 62this.startit() 63else{ 64this.curimageindex++ 65setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay) 66} 67} 68} 69 70function fadepic(obj){ 71if (obj.degree<100){ 72obj.degree+=10 73if (obj.tempobj.filters&&obj.tempobj.filters[0]){ 74if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+ 75obj.tempobj.filters[0].opacity=obj.degree 76else //else if IE5.5- 77obj.tempobj.style.filter="alpha(opacity="+obj.degree+")" 78} 79else if (obj.tempobj.style.MozOpacity) 80obj.tempobj.style.MozOpacity=obj.degree/101 81else if (obj.tempobj.style.KhtmlOpacity) 82obj.tempobj.style.KhtmlOpacity=obj.degree/100 83} 84else{ 85clearInterval(fadeclear[obj.slideshowid]) 86obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1" 87obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas) 88obj.populateslide(obj.tempobj, obj.nextimageindex) 89obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0 90setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay) 91} 92} 93 94fadeshow.prototype.populateslide=function(picobj, picindex){ 95var slideHTML="<div style=\"text-align:center;valign:middle\">" 96if (this.theimages[picindex][1]!="") //if associated link exists for image 97slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">' 98slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">' 99if (this.theimages[picindex][1]!="") //if associated link exists for image 100slideHTML+='</a>' 101picobj.innerHTML=slideHTML 102} 103 104 105fadeshow.prototype.rotateimage=function(){ 106if (this.pausecheck==1) //if pause onMouseover enabled, cache object 107var cacheobj=this 108if (this.mouseovercheck==1) 109setTimeout(function(){cacheobj.rotateimage()}, 100) 110else if (iebrowser&&dom||dom){ 111this.resetit() 112var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas) 113crossobj.style.zIndex++ 114fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50) 115this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0" 116} 117else{ 118var ns4imgobj=document.images['defaultslide'+this.slideshowid] 119ns4imgobj.src=this.postimages[this.curimageindex].src 120} 121this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0 122} 123 124fadeshow.prototype.resetit=function(){ 125this.degree=10 126var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas) 127if (crossobj.filters&&crossobj.filters[0]){ 128if (typeof crossobj.filters[0].opacity=="number") //if IE6+ 129crossobj.filters(0).opacity=this.degree 130else //else if IE5.5- 131crossobj.style.filter="alpha(opacity="+this.degree+")" 132} 133else if (crossobj.style.MozOpacity) 134crossobj.style.MozOpacity=this.degree/101 135else if (crossobj.style.KhtmlOpacity) 136crossobj.style.KhtmlOpacity=this.degree/100 137} 138 139 140fadeshow.prototype.startit=function(){ 141var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas) 142this.populateslide(crossobj, this.curimageindex)
143if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER 144var cacheobj=this 145var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid) 146crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1} 147crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0} 148} 149this.rotateimage() 150}
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.