salve a tutti, questo è il mio primo post qui.
ho spulciato mezzo web e tutto il forum, ma non sono riuscito a capire perchè questo codice:
codice:
var posizione= 1;
function scorriA(id)
{
window.document.getElementById('avn').style.backgroundColor= 'white';
if((navigator.appName=="Netscape")||(navigator.appName=="Opera"))
{
prop=getComputedStyle(document.getElementById(id),'');
}
else
{
prop=document.getElementById(id).currentStyle.left;
}
margineR=parseInt(prop.getPropertyValue('right'));
margineL=parseInt(prop.getPropertyValue('left'));
spola=window.document.getElementById(id);
if (margineL > -800)
{
spola.style.left=margineL-10;
setTimeout(function() {scorriA(id)}, 1);
}
else
{
window.document.getElementById('ind').style.backgroundColor= 'teal';
}
}
function scorriD(id)
{
window.document.getElementById('ind').style.backgroundColor= 'white';
if((navigator.appName=="Netscape")||(navigator.appName=="Opera"))
{
prop=getComputedStyle(document.getElementById(id),'');
}
else
{
prop=document.getElementById(id).currentStyle.left;
}
margineR=parseInt(prop.getPropertyValue('right'));
margineL=parseInt(prop.getPropertyValue('left'));
spola=window.document.getElementById(id);
// alert(margineL);
if (margineL < 0 )
{
spola.style.left=margineL+10;
setTimeout(function() {scorriD(id)}, 1);
}
else
{
window.document.getElementById('avn').style.backgroundColor= 'teal';
}
}
mi restituisce "errore nell'interpretazione della proprietà left" in FF ma SOLO se lo uso in una pagina con diversi elementi, se creo una pagina apposta con solo gli elementi necessari per farlo funzionare allora va...
sono alla frutta, le ho tentate tutte, dove sbaglio???