Hi there,
first one simple thing. I think that in the resetit function,
Code:
crossobj.style.KhtmlOpacity=obj.degree/100
should be:
Code:
crossobj.style.KhtmlOpacity=this.degree/100
The more serious problem is with certain IE6 settings where a check for a filter property fails with an "Unspecified error", e.g.:
Code:
if (crossobj.filters&&crossobj.filters[0]){
I can not say what settings are actually responsible, but the problem popped up previously on these forums. What I did to make it at least work without the fading effect was to create a new SetIeOpacity function:
Code:
function SetIeOpacity(crossobj,degree)
{
try
{
if (crossobj.filters&&crossobj.filters[0]&&(typeof crossobj.filters[0].opacity=="number")){ //if IE6+
crossobj.filters(0).opacity=this.degree
return
}
}
catch(e){}
if(crossobj.style.filter)
crossobj.style.filter="alpha(opacity="+degree+")"
}
and change the fadepic and resetit functions as follows:
Code:
function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if(iebrowser&&dom) // if IE5+
SetIeOpacity(obj.tempobj,obj.degree)
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if(iebrowser&&dom) // if IE5+
SetIeOpacity(crossobj,this.degree)
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
}
I'm not sure if IE4 and the like would still stumble over try/catch even if it is in a function that is not called on these platforms. Maybe someone more experienced with this can replace the try/catch with onerror or suggest a better solution to catch the "Unspecified error".
Best regards,
Jens.
Bookmarks