Prova questo e non dimenticare il punto 3)
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/sh...191419Licensed under: Public Domain */ 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() { aLI=document.getElementById('news2').getElementsByTagName('li'); for(var i=0; i<aLI.length; i++) { aLI[i].style.display="none"; aLI[i].getElementsByTagName('p')[0]; } rotate2(aLI.length-1); }; var aLI=[]; 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) { aLI[idx].style.display="none"; idx=(idx<aLI.length-1)? ++idx : 0; aLI[idx].style.display="block"; timerRUN=setTimeout('rotate('+idx+')', Speed); } function inView() { var newsItem=0; for(var i=0; i<aLI.length; i++) { if(aLI[i].style.display=="block") {newsItem= i;} } return newsItem; } // Multiple onload function created by: Simon Willison // http://simonwillison.net/2004/May/26/addLoadEvent/ function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } } addLoadEvent(function() { postNews(); postNews2() });