così gira,testato su ie8 e su firefox:
codice:
// This script and many more are available free online at
//The JavaScript Source!! http://javascript.internet.com
//Created by: Fang | http://www.webdeveloper.com/forum/s...=191419Licensed under: Public Domain
//adapted by: Luca Vizzi http://www.lucavizzi.it
function postNews() {
aLI=document.getElementById('news').getElementsByTagName('li');
for(var i=0; i<aLI.length; i++) {
aLI[i].style.display="none";
aLI[i].getElementsByTagName('p')[0];
}
rotate(aLI.length-1);
};
function postNews2() {
aLI2=document.getElementById('news2').getElementsByTagName('li');
for(var j=0; j<aLI2.length; j++) {
aLI2[j].style.display="none";
aLI2[j].getElementsByTagName('p')[0];
}
rotate2(aLI2.length-1);
};
var aLI=[];
var aLI2=[];
var timerRUN=null;
var Speed=3000; // change as required
function rotate(idx) {
aLI[idx].style.display="none";
idx=(idx<aLI.length-1)? ++idx : 0;
aLI[idx].style.display="block";
timerRUN=setTimeout('rotate('+idx+')', Speed);
}
function rotate2(idx) {
aLI2[idx].style.display="none";
idx=(idx<aLI2.length-1)? ++idx : 0;
aLI2[idx].style.display="block";
timerRUN=setTimeout('rotate2('+idx+')', Speed);
}
if (document.attachEvent){
window.attachEvent("onload",postNews);
window.attachEvent("onload",postNews2);
}else{
window.addEventListener('load',postNews,false);
window.addEventListener('load',postNews2,false);
}