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