Hintergrundanimation

Moderator: HTML-Laie

Antworten
Benutzeravatar
Hape
Administrator
Beiträge: 336
Registriert: Fr 22. Mai 2020, 00:33

Hintergrundanimation

Beitrag von Hape »

Code: Alles auswählen

<SCRIPT language="JavaScript">
// CREDITS:
// Background Slideshow 2
// by Peter Gehrig
// Copyright (c) 2010 Peter Gehrig. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at http://www.fabulant.com/
// info@fabulant.com
// 2/8/2010

// IMPORTANT:
// If you add this script to a script-library or a script-archive
// you have to insert a link to http://www.fabulant.com/fast/index.html
// right into the webpage where the script will be displayed.

// Put the background-images into the same folder as your webpage.
// Add the filnames of your background-images to the Array below (just replace
// our background-images with your background-images)
var slideurl=new Array("/1.gif","/2.gif","/3.gif","/4.gif","/5.gif")

// swapping speed (seconds)
var slidestandstill=2

// do not edit the code below
var timer
var ns4=document.layers?1:0
var ns6=document.getElementById&&!document.all?1:0
var ie=document.all?1:0

if (ie || ns6) {
  var imgpreload=new Array()
    for (i=0;i<=slideurl.length-1;i++) {
      imgpreload[i]=new Image()
      imgpreload[i].src=slideurl[i]
    }
}

var i_slideurl=0

slidestandstill=slidestandstill*1000

function swapimages() {
  document.body.background=slideurl[i_slideurl]
    i_slideurl++
    if (i_slideurl>=slideurl.length) {i_slideurl=0}
  timer=setTimeout("swapimages()",slidestandstill)
}

if (ie || ns6) {
  window.onload=swapimages
}
</SCRIPT><P align=Center>
<P align=Center>
 <button onclick="goBack()">zurück</button>

<script>
function goBack() {
    window.history.back();
}
</script>
Demoseite hier: https://hapes-javascript-demo-page.hpag ... ation.html
Dateianhänge
bg-images.zip
(1.85 KiB) 244-mal heruntergeladen

Antworten