BACKGROUND IMAGE SCROLLER

Moderator: HTML-Laie

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

BACKGROUND IMAGE SCROLLER

Beitrag von Hape »

Animieren Sie Ihr Hintergrundbild mit diesem Script.

Code: Alles auswählen

<script>
// CREDITS:
// Background Image Scroller
// 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

// IMPORTANT:
// If you add this script to a script-library or script-archive
// you have to add a highly visible link to
// http://www.fabulant.com on the webpage
// where this script will be featured

// START CONFIGURATION HERE
// URL of floating image
var slide="bg.gif"

// END CONFIGURATION HERE
// Do not edit the code below this line
var imgpreload=new Image()
imgpreload.src=slide
var pos=0;
var maxpos=99999999999999;

function initscroll(){
		document.body.background=slide;
		doscroll()
}
function doscroll(){
	pos++;
    document.body.style.backgroundPosition=pos+" "+pos;	
    var timer=setTimeout("doscroll()",30);
}
window.onload=initscroll;

</script>
Hier die Demoseite dazu: Background Image Scroller

Antworten