Fabienne: Hintergrundbilder dynamisch wechseln

Beitrag lesen

Hallo zusammen,
anbei das komplette Script:

<html>
<head>
<title>Test</title>
<style type="text/css">

body,td,font,p,tr,table,span
{
 font-family: Arial,Helvetica,sans-serif;
 font-size: 10;
 font-weight: normal;
  color: #000000;
 text-decoration: none;
}

.headline
{
 font-family: Arial,Helvetica,sans-serif;
 font-size: 15.px;
 font-weight: normal;
  color: #000000;
 text-decoration: none;
}

a:link
{
 font-family: Arial,Helvetica,sans-serif;
 font-size: 10;
 font-weight: normal;
  color: #000000;
 text-decoration: underline;
}

a:visited
{
 font-family: Arial,Helvetica,sans-serif;
 font-size: 10;
 font-weight: normal;
  color: #000000;
 text-decoration: underline;
}

a:hover
{
 font-family: Arial,Helvetica,sans-serif;
 font-size: 10;
 font-weight: normal;
  color: #000000;
 text-decoration: underline;
}

</style>

</head>
<body bgcolor="#FFFFFF" onload="rotateIt()" background="movies/1149272030_HFqzeYv8Z4_1.jpg">
<TABLE cellpadding="5" cellspacing="0" border="0" width="100%" height="100%">
<tr><td valign=center align="center" width="100%" height="100%">

<script language="JavaScript">
                      <!--

function HintergrundbildWechseln(Hintergrundbild)
                      {
                          document.getElementsByTagName('body')[0].background = Hintergrundbild;
                      }

var number_of_pics=2;

var counter=0;
                      var pic=new Array();

for(i=0;i<number_of_pics;i++)
                       {
                        pic[i]=new Image();
                       }
                      pic[0].src='movies/1149272030_HFqzeYv8Z4_1.jpg';
                      pic[1].src='movies/1149272030_HFqzeYv8Z4_3.jpg';

function rotateIt(){

document.body.style.backgroundImage = 'url(' + pic[counter].src + ')';

//                     document.getElementsByTagName('body')[0].background = pic[counter].src;
//                       document.background_bild.src=pic[counter].src;

counter++;

if ( counter > number_of_pics-1 )
                       {
                          counter=0;
                          }

setTimeout("rotateIt()",4000);
                        }
                       }

// End Hiding -->

</script>

<script LANGUAGE="JavaScript">
                      <!-- Hide JavaScript from Java-Impaired Browsers
                      //rotateIt();
                      // End Hiding -->
                      </script>

<TABLE cellpadding="5" cellspacing="0" border="0" width="300">
          <tr><td valign=center colspan="2" align="center"><span class="headline">Testfilm</span></td></tr>

<tr>
          <td valign=center>
          <OBJECT ID="MediaPlayer" width="320" height="300"    classid ="CLSID: 6BF52A52-394A-11d3-B153-00C04F79FAA6"
           codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"
           standby="Windows Media Player Componenten werden geladen..."
           type="application/x-oleobject">
           <param name="FileName"      value="catinfan.wmv">
              <param name="URL"           value="/movies/1149272030_HFqzeYv8Z4_isdn.wmv">
              <param name="background"    value="#ffffff">
           <PARAM NAME="uiMode" VALUE="Mini">
           <PARAM NAME="AutoStart" VALUE="true">
           <param name="ShowStatusBar" value="true">
           <PARAM NAME="ShowControls" VALUE=1>
           <PARAM NAME="ShowDisplay" VALUE=0>
              <PARAM NAME="stretchToFit" VALUE=1>
           <PARAM NAME="DisplaySize" VALUE=1>
           <param name="VOLUME"      value="80">
           <EMBED type="application/x-mplayer2"
              pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"
           src="/movies/1149272030_HFqzeYv8Z4_isdn.wmv"
              Name="MediaPlayer"
              uiMode="Mini"
           AutoStart=1 ShowStatusBar=1 ShowControls=1
           ShowDisplay=0
           displaysize=1
              stretchToFit=1
           volume=80
           width="320" height="300"></EMBED>
          </OBJECT>
          </td>
          <td valign=top align=left nowrap>

</td>
          </tr>
          <tr><td colspan="2" align="center"><!--catinfan.wmv--><a target="wiewowas.info_video" href="/?load&version=dsl&id=1149272030_HFqzeYv8Z4&PHPSESSID=29f1bdfe62cc061b2b680e535ec9814c">DSL</a></td></tr>
          <tr><td colspan="2" align="center"></td></tr>
          </table>

</td></tr>
          </table>

</body></html>

Viele Grüße und besten Dank für Eure Arbeit am Sonntag!