<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style type="text/css"> body{ background:url(1.jpg); } </style> <script type="text/javascript"> var compteur=0 tbimage=new Array('1.jpg','2.jpg','3.jpg','4.jpg','5.jpg','6.jpg') function pouic(){ if(compteur==tbimage.length){ compteur=0 } document.body.style.cssText='background:url('+tbimage[compteur]+')' compteur++ setTimeout(pouic,2000) } </script> </head> </html>
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript"> tbimage=new Array('1.jpg','2.jpg','3.jpg','4.jpg','5.jpg','6.jpg') function pouic(){ document.body.style.cssText='background:url('+tbimage[Math.round(Math.random()*(tbimage.length-1))]+')' } </script> </head>
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question