par
alaingpl » 13 déc. 2006, 15:27
Merci pour le titre. Il est plus judicieux.
Après une lecture du script il semble que c'est cette fonction qui a un soucis. Elle permet le défilement automatique de photos situées dans un dossier.
La ligne qui pose problème est la 379 soit :
Code : Tout sélectionner
function AutoNextImg()
{
switch (CurrentImg.id)
{
case "IsLoaded" :
CurrentImg.id="CanNext";
AutoTimer = setTimeout('AutoNextImg()',TimePauseAuto);
break;
case "CanNext" :
CurrentImg.id="Loading";
CurrentImgLoading.style.display="block";
CurrentImg.style.display="none";
if (CurrentImg.filters) CurrentImg.filters.alpha.opacity=0;
i = CurrentList.selectedIndex + 1;
if (i > CurrentList.length - 1) {i = 0};
ImgURL=CurrentList[i].value;
UpdateComment(ImgURL);
if (ImgURL.lastIndexOf('#')!=-1)
{
ImgURL=ImgURL.substring(0,ImgURL.lastIndexOf(".")+1) + 'thumb';
}
else if (ResampledSize > 0)
{
ImgURL = 'resize.php?img_path=' + ImgURL + '&width=' + ResampledSize + '&height=' + ResampledSize + '&onlyshow=0';
CurrentList[i].value=CurrentList[i].value + '#';
}
NImg=new Image();
NImg.name='N'+ CurrentImg.name;
NImg.src=ImgURL;
TabNewImg[TabNewImg.length]=NImg;
WaitComplete();
CurrentList.selectedIndex = i;
AutoTimer = setTimeout('AutoNextImg()',100);
break;
case "Loading" :
AutoTimer = setTimeout('AutoNextImg()',100);
break;
}
}
function IniAutoDiapo(DivElement,ImgElement,ImgLoadingElement,ListBox)
{
if (CurrentDiapo)
{
StrTitle=CurrentDiapo.childNodes[1].data;
if (StrTitle.search(/automatique/)!= -1) CurrentDiapo.childNodes[1].data=StrTitle.substring(0,StrTitle.lastIndexOf("("));
}
clearTimeout(AutoTimer);
CurrentImg=ImgElement;
CurrentImgLoading=ImgLoadingElement;
CurrentList=ListBox;
CurrentDiapo=DivElement;
StrTitle=CurrentDiapo.childNodes[1].data;
if (StrTitle.search(/automatique/)== -1) CurrentDiapo.childNodes[1].data=StrTitle + "(automatique)";
if (CurrentImg.id=="CanNext") CurrentImg.id="IsLoaded";
AutoNextImg();
}
function StopAuto(ImgElement)
{
if (CurrentImg) if (ImgElement.name==CurrentImg.name)
{
StrTitle=CurrentDiapo.childNodes[1].data;
if (StrTitle.search(/automatique/)!= -1) CurrentDiapo.childNodes[1].data=StrTitle.substring(0,StrTitle.lastIndexOf("("));
clearTimeout(AutoTimer);
}
}
Je n'arrive pas à saisir d'où viens le pbl.
Merci pour le titre. Il est plus judicieux.
Après une lecture du script il semble que c'est cette fonction qui a un soucis. Elle permet le défilement automatique de photos situées dans un dossier.
La ligne qui pose problème est la 379 soit :
[code]case "Loading" :[/code]
[code]function AutoNextImg()
{
switch (CurrentImg.id)
{
case "IsLoaded" :
CurrentImg.id="CanNext";
AutoTimer = setTimeout('AutoNextImg()',TimePauseAuto);
break;
case "CanNext" :
CurrentImg.id="Loading";
CurrentImgLoading.style.display="block";
CurrentImg.style.display="none";
if (CurrentImg.filters) CurrentImg.filters.alpha.opacity=0;
i = CurrentList.selectedIndex + 1;
if (i > CurrentList.length - 1) {i = 0};
ImgURL=CurrentList[i].value;
UpdateComment(ImgURL);
if (ImgURL.lastIndexOf('#')!=-1)
{
ImgURL=ImgURL.substring(0,ImgURL.lastIndexOf(".")+1) + 'thumb';
}
else if (ResampledSize > 0)
{
ImgURL = 'resize.php?img_path=' + ImgURL + '&width=' + ResampledSize + '&height=' + ResampledSize + '&onlyshow=0';
CurrentList[i].value=CurrentList[i].value + '#';
}
NImg=new Image();
NImg.name='N'+ CurrentImg.name;
NImg.src=ImgURL;
TabNewImg[TabNewImg.length]=NImg;
WaitComplete();
CurrentList.selectedIndex = i;
AutoTimer = setTimeout('AutoNextImg()',100);
break;
case "Loading" :
AutoTimer = setTimeout('AutoNextImg()',100);
break;
}
}
function IniAutoDiapo(DivElement,ImgElement,ImgLoadingElement,ListBox)
{
if (CurrentDiapo)
{
StrTitle=CurrentDiapo.childNodes[1].data;
if (StrTitle.search(/automatique/)!= -1) CurrentDiapo.childNodes[1].data=StrTitle.substring(0,StrTitle.lastIndexOf("("));
}
clearTimeout(AutoTimer);
CurrentImg=ImgElement;
CurrentImgLoading=ImgLoadingElement;
CurrentList=ListBox;
CurrentDiapo=DivElement;
StrTitle=CurrentDiapo.childNodes[1].data;
if (StrTitle.search(/automatique/)== -1) CurrentDiapo.childNodes[1].data=StrTitle + "(automatique)";
if (CurrentImg.id=="CanNext") CurrentImg.id="IsLoaded";
AutoNextImg();
}
function StopAuto(ImgElement)
{
if (CurrentImg) if (ImgElement.name==CurrentImg.name)
{
StrTitle=CurrentDiapo.childNodes[1].data;
if (StrTitle.search(/automatique/)!= -1) CurrentDiapo.childNodes[1].data=StrTitle.substring(0,StrTitle.lastIndexOf("("));
clearTimeout(AutoTimer);
}
}[/code]
Je n'arrive pas à saisir d'où viens le pbl.