this modification will ensure the image is loaded from the server
but best post a link to the problem pageCode:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title></title> <script type="text/javascript"> /*<![CDATA[*/ var Imgs=[]; function ImgLoad(cls){ var as=zxcByClassName(cls); for (var z0=0;z0<as.length;z0++){ if (as[z0].getAttribute('rel')&&as[z0].getElementsByTagName('IMG')[0]){ oop=new Fade(as[z0].getElementsByTagName('IMG')[0],as[z0].getAttribute('rel')); Imgs.push(oop); } } CkTop(); } function Fade(img,src){ this.img=img; this.src=src+'?'+new Date().getTime(); this.opc=0; zxcOpacity(this.img,0); } Fade.prototype.fade=function(){ if (this.opc==0) this.img.src=this.src; zxcOpacity(this.img,this.opc++); var oop=this; if (this.opc<101) setTimeout(function(){ oop.fade(); },10); } function CkTop(){ for (var z0=0;z0<Imgs.length;z0++){ if (zxcPos(Imgs[z0].img)[1]<zxcWWHS()[1]+zxcWWHS()[3]&&Imgs[z0].opc==0){ Imgs[z0].fade(); Imgs.splice(z0,1); z0--; } } } function zxcOpacity(obj,opc){ if (opc<0||opc>100) return; obj.style.filter='alpha(opacity='+opc+')'; obj.style.opacity=obj.style.MozOpacity=obj.style.KhtmlOpacity=opc/100-.001; } function zxcWWHS(){ if (window.innerHeight) return [window.innerWidth-10,window.innerHeight-10,window.pageXOffset,window.pageYOffset]; else if (document.documentElement.clientHeight) return [document.documentElement.clientWidth-10,document.documentElement.clientHeight-10,document.documentElement.scrollLeft,document.documentElement.scrollTop]; return [document.body.clientWidth,document.body.clientHeight,document.body.scrollLeft,document.body.scrollTop]; } function zxcPos(obj){ var rtn=[0,0]; while(obj){ rtn[0]+=obj.offsetLeft; rtn[1]+=obj.offsetTop; obj=obj.offsetParent; } return rtn; } function zxcByClassName(nme,el,tag){ if (typeof(el)=='string') el=document.getElementById(el); el=el||document; for (var tag=tag||'*',reg=new RegExp('\\b'+nme+'\\b'),els=el.getElementsByTagName(tag),ary=[],z0=0; z0<els.length;z0++){ if(reg.test(els[z0].className)) ary.push(els[z0]); } return ary; } window.onscroll=CkTop; /*]]>*/ </script> </head> <body onload="ImgLoad('img')"> <a class="img" rel="http://www.vicsjavascripts.org.uk/StdImages/Two.gif"><img src="http://www.vicsjavascripts.org.uk/StdImages/Blank.gif" width="50" height="50" /></a> <div style="height:800px;"></div> <a class="img" rel="http://www.vicsjavascripts.org.uk/StdImages/Three.gif"><img src="http://www.vicsjavascripts.org.uk/StdImages/Blank.gif" width="50" height="50" /></a> </body> </html>



Reply With Quote




Bookmarks