ho questo script: mi funziona con Explorer ma non con Firefox...dove devo correggere?
Il javascript:
codice:
function ShowHideToggle(psClass, pimgSource, psSub, psImg, psSearchType) {
var rowtags;
var nLoop;
var imgTurn;
var imgTurn2;
var sDisplay;
if (pimgSource.length == 0)
return false;
imgTurn = document.all(pimgSource);
imgTurn2 = document.all(psImg);
if (!imgTurn.src)
return false;
if (!psSearchType)
psSearchType = 'TR';
rowtags = document.all.tags(psSearchType);
if (imgTurn.src.substring(imgTurn.src.lastIndexOf('/') + 1)=='ico_frecciaTitoli.gif')
{
imgTurn.src = imgTurn.src.substring(0,imgTurn.src.lastIndexOf('/')) + '/ico_frecciaTitoligiu.gif';
sDisplay = '';
}
else
{
imgTurn.src = imgTurn.src.substring(0,imgTurn.src.lastIndexOf('/')) + '/ico_frecciaTitoli.gif';
sDisplay = 'none';
}
if (rowtags !=null)
{
for(nLoop=0; nLoop<rowtags.length; nLoop++)
{
if (rowtags[nLoop].className==psClass || (rowtags[nLoop].className==psSub && sDisplay=='none'))
{
rowtags[nLoop].style.display = sDisplay;
}
}
}
if (!imgTurn2.src)
return false;
if (imgTurn2.src.substring(imgTurn2.src.lastIndexOf('/') + 1)=='ico_frecciaTitoligiu.gif')
{
imgTurn2.src = imgTurn2.src.substring(0,imgTurn2.src.lastIndexOf('/')) + '/ico_frecciaTitoli.gif';
}
}
il richiamo del js:
codice:
OnClick = "ShowHideToggle('0_Class','img0', '1_Class', 'img1');"