Народ подскажите как сделать автоматическую смену фона ячейки таблицы?
Нашел код для тега боди:
| Код | <html> <head> <script language="javascript"> <!--
var bgrounds=new Array( "./fon/sindey.jpg", "./fon/berlin.jpg", "./fon/rio.jpg");
function changeBg() { var i=Math.floor(bgrounds.length*Math.random()); document.body.background=bgrounds[i]; setTimeout('changeBg()',5000) } //--> </script> </head>
<body onLoad="setTimeout('changeBg()')"> <table width="100%" bgcolor="#FFFFFF"> <tr> <td> 11111 </td> </tr> </table>
</body> </html>
|
Все работает но как мне его перенести в <td>? такая перестановка не работает
| Код | <html> <head> <script language="javascript"> <!--
var bgrounds=new Array( "./fon/sindey.jpg", "./fon/berlin.jpg", "./fon/rio.jpg");
function changeBg() { var i=Math.floor(bgrounds.length*Math.random()); document.all.background=bgrounds[i]; setTimeout('changeBg()',5000) } //--> </script> </head>
<body > <table width="100%" > <tr> <td onLoad="setTimeout('changeBg()')"> 11111 </td> </tr> </table>
</body> </html>
|
Спасибо |